Which HTTP header indicates the media type the client accepts in a REST API request?
Choose an answer
Tap an option to check your answer.
Correct answer: Accept: application/json.
Why this is the answer
The Accept header specifies the media types (e.g., application/json, text/html) that the client is capable of processing and prefers to receive in the response. This allows the server to send data in a format the client can understand. Accept-Encoding indicates the compression algorithms the client supports. Accept-Patch specifies the patch document formats the client accepts. Content-Type, conversely, indicates the media type of the request body being sent by the client to the server, not what the client accepts in return.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed