I'm having trouble understanding something about Content Negotiation in HTTP protocol.
I understand that when the header Accept is sent in a request, it's telling the server that it expects the response in that format.
For instance, if the Header Accept have the value application/json
then the server must send the response in JSON format. If it can't do this, it sends the HTTP error 406 Not Acceptable
(although most web applications don't do it because the end user would not understand want happen. This is specified so in documentation https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406).
My problem is if the request send in the header Content-Type
the format in which it intends to receive the representation of the resource in the response, and the server application respects this mechanism (content negotiation) then the header Content-Type
of the response must have the same value if not, then it must be returned the HTTP error 406 Not Acceptable
?