Google News
logo
Rest API - Interview Questions
What are the main parts of an HTTP request?
HTTP requests are sent by the client to the API. They request data or perform some action on the server. There are five main components of an HTTP request in REST :
 
* Start line : Indicates the intended action of the request and includes:

* a request method that indicates the HTTP request method to be performed on the resource (i.e., GET, POST, PUT, DELETE).

* a URI that identifies the requested resource on the server.

* the HTTP version being used, which signals which version the API should respond with.

* HTTP Request Header : Lists metadata about the request, such as the user agent, file formats the client will accept, format of the request body, language, caching preferences, etc.

* HTTP Request body : Contains any data associated with the request. This is only necessary if the request is to modify data on the server with the POST or PUT methods.
Advertisement