Before jumping onto HTTP Requests, let's first discuss a bit about HTTP.
HTTP stands for HyperText Transfer Protocol.
HTTP is entirely based on the client-server model.
The client initiates the request then waits until it receives a response from the server.
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)
๐ GET
The GET method is the most common of all these request methods. It is used to get the desired resources from the server.
The GET methods don't affect the state of the server.
๐ POST
The POST method is used to submit the information to the server. As we're submitting data, the POST method often changes the state of the server.
๐ PUT
The PUT method is used whenever you need to change the resource. The resource, which is already a part of resource collection.
๐ PATCH
The PATCH request method is used to modify only the necessary part of the data or response. The PATCH method doesn't modify the entire response.
๐ HEAD
The server sends the response without the body. The HEAD method asks for a response identical to that of a GET request, but it is faster as small data is transferred.
๐ DELETE
As the name says, the DELETE request method is used to delete the specified resource.
It requests that the origin server delete the resource identified by the Request-URL.
๐ CONNECT
The CONNECT method establishes two-way communication between the client and the requested resource.
CONNECT request method is used to push your proxy to start an HTTP tunnel.
๐ OPTIONS
The OPTIONS method is used to describe the communication options available for the target resource.
The client can either specify a URL for describing the communication options available for a specific resource or an asterisk (*) if they want to target the server.
๐ TRACE
The TRACE method is generally used for debugging. It performs a message loop-back test along the path to the desired data.
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.
Definitions of most widely used terms in API development:
- SDK
- RPC
- CORS
- API Key
- Async API
- Internal API
- API Caching
- External API
- HTTP cookies
- Authorization
- Microservices
- OpenAPI spec
- Composite API
- API Versioning
- Authentication
A Thread ๐งต๐๐ป
๐ SDK
SDK stands for Software Development Kit.
It is a set of development tools that allows the creation of software or an application for a particular platform.
SDK provides you with the whole package from compilers to debuggers to even a software development framework.
๐ RPC
Remote Procedure Call (RPC) is the oldest client-server communication method in use today.
Instead of the traditional HTTP call, RPC uses a function call.
It means that you invoke a function written on the server-side code on the client-side.