Endpoints4:01 with Alena Holligan
Endpoints are the workhorses of our APIs. Let's talk about what they're expected to do and how to design them.
Choose your platform and you can download an auto-installer. There is no fancy setup. Just run the program like any other program on your computer.
Resource, Endpoint and Actions
A resource is a piece of data, which usually comes out of a database (but doesn't have to!). Resources are gathered together into collections. Resources are usually available at endpoints that point to either individual resources or collections of resources. Endpoints don't represent actions that you take on those resources, though. Actions are determined by the data provided to an endpoint and the HTTP method used to access the endpoint.
By combining endpoints and HTTP methods, we can build complete sentences with just HTTP and REST.
URL vs URI, what's the difference?
The acronyms URL and URI are often used interchangeably. Although they can be referencing the same thing, there are some distinctions. Here is a brief summary:
- URI stands for "Uniform Resource Identifier", the keyword being "Identifier". This can mean name, location, or both.
- Example: /api/v1/games/1234
- URL stands for "Uniform Resource Locator", the keyword being "Locator" so it provides full details to locate the resource.
- Example: https://teamtreehouse.com/alenaholligan
- The part that makes something a URL is the combination of the name and an access method, such as https://, or mailto:.
- URLs are URIs, but the opposite is not true. So saying URI is always technically accurate, but if you are discussing something that’s both a full URL and a URI (which all URLs are), it’s best to call it a “URL” because it’s more specific.
To learn more, visit the following resources:
You need to sign up for Treehouse in order to download course files.Sign up