I understand that the Accept
HTTP header defines a data type expected in a response sent from the server, so it's used as a response header.
My question is regarding the Content-Type
, it's used by a client to define the body format of a request sent. I always used it as part of a client request, so I have a client request where I set the headers with Accept
and Content-Type
. And recently, I came across a project where the Content-Type
is defined in the response headers (so sent by the server).
So my question is: Content-Type
need to be set as part of the client request header or as part of the server response header or can it be set to both?