Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Endpoints are the workhorses of our APIs. Let's talk about what they're expected to do and how to design them.
Download Postman
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:
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up