10 Tweets 8 reads Mar 02, 2022
Anatomy of an API endpoint.
Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
Before breaking the endpoints into multiple parts. Let's first see what exactly is an endpoint.
The endpoint is nothing but the URL to access resources.
Every API must have at least one endpoint.
A typical endpoint or URL starts with the scheme.
Scheme is nothing but the protocol for APIs.
For example, HTTPS, HTTP, FTP, SSL, etc.
The next thing after the scheme is the domain.
The actual location where the request goes.
For example, in this case, we are requesting data from "example[dot]com" domain.
After scheme and domain, we have routes where the different resources can be found.
Consider domain as house and routes as rooms.
A single domain (house) can have multiple routes (rooms).
The next thing we have is query parameters.
A particular endpoint can have more than one query parameter.
Parameters are nothing but extra information required by the API to process requests.
Query parameter starts with a question mark (?).
You can mention more than one query parameter using Ampersand (&) separator.
For example,
?authon=Joe&tag=API
Here, we are requesting all the posts from Joe having API tag.
Parameters are further divided into four categories.
โ€ข Path Parameters
โ€ข Query String Parameters
โ€ข Header Parameters
โ€ข Request Body Parameters
Check out this detailed Guide.
RapidAPI.com
Endpoint won't allow you to insert empty space or special characters.
What if we want all the posts from John Doe?
In that case, we use URL encoding.
% + Hex ASCII value.
With that being said, that's pretty much it for this thread.
Follow @Rapid_API for more exclusive content. ๐Ÿ™๐Ÿ’™

Loading suggestions...