The HTTP Acceptrequest and response header indicates which content types, expressed as MIME types , the sender is able to understand.
In requests, the server uses content negotiation to select one of the proposals and informs the client of the choice with the Content-Type response header.
In responses, it provides information about which content types the server can understand in messages to the requested resource, so that the content type can be used in subsequent requests to the resource.
Browsers set required values for this header based on the context of the request.
For example, a browser uses different values in a request when fetching a CSS stylesheet, image, video, or a script.
* Values can't contain CORS-unsafe request header bytes , including "():<>?@[\]{},, Delete 0x7F, and control characters 0x00 to 0x19, except for Tab 0x09.
Systems that involve API interaction commonly request application/json responses.
Here's an example of a GET request where the client specifically requests a JSON response:
http
GET /users/123 HTTP/1.1
Host: example.com
Authorization: Bearer abcd123
Accept: application/json