Different components in Rest API header?

 


Different components in Rest API header?

Headers are mostly classified as request and response headers - property-value pairs that are separated by a colon. Set the request headers when you are sending the request > Set the assertion against the response headers. Some header types,


Authorization: Carries credentials containing the authentication information of the client for the resource being requested.

• Content-Type: The MIME type of the request or response. E.g., text/html or text/JSON.

• Date: The date and time of the request or response.

• Accept: Informs the server about the types of data that can be sent back. E.g., Accept-Charset: which character sets are acceptable by the client.

• WWW-Authenticate: Sent by the server if it needs a form of authentication before it can respond with the actual resource being requested. Often sent along with a response code of 401, which means ‘unauthorized’.

• Cache-Control: Cache policy defined by the server for this response, a cached response can be stored by the client and re-used till the time defined by the Cache-Control header.

• Expires: Response header indicating the time after which the response is considered stale.

• Set-Cookie: Send cookies from the server to the user-agent.

Post a Comment