Content-Type or Accept: which header does what?
QuizEasy-MediumAsked in: Capgemini
A test sends a JSON body in a POST request and wants a JSON response. Which statement is correct?
- Content-Type: application/json describes the body being sent; Accept: application/json says which format the client wants back
- Accept describes the request body; Content-Type asks for the response format
- Only Accept is needed, because the server can always guess the body format
- The two headers are the same and either one works
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.