19 Tweets 32 reads Feb 03, 2022
What exactly is the HTTP-based system.
Thread ๐Ÿงต๐Ÿ‘‡๐Ÿป
HTTP is a communication protocol that establishes the connection between web browsers and web servers.
HTTP is entirely based on the client-server model, where the client initiates the request then waits until it receives a response from the server.
Typically, there are 3 main components in the HTTP-based system. ๐Ÿ‘‡๐Ÿป
The client can initiate the request using HTTP request methods.
๐Ÿ“Œ HTTP request methods are the actions initiated from the client-side to get the desired resource.
There are 9 HTTP request methods:
- GET
- PUT
- POST
- HEAD
- TRACE
- PATCH
- DELETE
- OPTIONS
- CONNECT
But there are four widely used HTTP verbs:
๐Ÿ“„ GET (read existing data)
๐Ÿ“ฒ POST (create a new response or data)
โ™ป๏ธ PATCH (update the data)
๐Ÿ—‘๏ธ DELETE (delete the data)
Check out this thread for a detailed explanation of each and every HTTP verb.
There are three main characteristics of HTTP Request Methods:
1. Safe
2. Idempotent
3. Cacheable
๐Ÿ“Œ Safe
We can call an HTTP request method safe if it doesn't affect the server's state.
The safe methods request the server to send data without performing any modification to the original data. Hence safe methods accomplish read-only operations.
๐Ÿ“Œ Idempotent
Idempotent methods have no side effects on the server. We can call them in a row, and they guarantee that they will not affect the server state (except for keeping statistics).
GET, HEAD, OPTIONS, PUT, DELETE, and TRACE methods are idempotent.
๐Ÿ“Œ Cacheable
As the term suggests, we can call HTTP response methods cacheable if it is possible to cache the response for later use.
Moving forward, what if the client or server wants to send an extra bit of information through request or respectively?
Here HTTP headers come into play. ๐Ÿ‘‡๐Ÿป
The HTTP headers are divided into four categories:
1๏ธโƒฃ Request headers: Client to Server
2๏ธโƒฃ Response headers: Server to Client
3๏ธโƒฃ Representation headers: Information about the body of the resource
4๏ธโƒฃ Payload headers: Information about the payload data
We have a well-written thread on HTTP headers. Please give it a read. ๐Ÿ‘‡๐Ÿป
The next thing we have is HTTP response status codes.
๐Ÿ”น Informational (100โ€“199)
๐Ÿ”น Successful (200โ€“299)
๐Ÿ”น Redirects (300โ€“399)
๐Ÿ”น Client errors (400โ€“499)
๐Ÿ”น Server errors (500โ€“599)
Server Error Responses (5xx) ๐Ÿ‘‡๐Ÿป
In this thread, we have explained all the status codes in detail.
And that's pretty much about it for this thread.
We hope you find this helpful. If so, share it with your connections. ๐Ÿ˜‰
Also, visit RapidAPI Hub(RapidAPI.com) for more than 35,000 excellent APIs.

Loading suggestions...