I was trying to find if there is some kind of reference about what type of informations are important to be passed on the HTTP Header.
I understand that some information seems natural to be there, like the Authorization, Content-Type, Accept, and so on.
Some articles explains that the HTTP Header are used to send optional or additional informations about the request.
What I understand about the HTTP Header objetive is: send informations that are useful for all (or almost all) requests made to the API.
But all this continues to be very vague to me.
Many APIs use them to pass additional information about the authorized user and, of course, the Authorization header. But pass the authorization/user informations on HTTP Headers is a generalized concept for me. I'm looking for an explanation that could clarify the use (or not) for specific API problems.
Per example, see this question. I'm sure that the platform and user could be send through the HTTP Headers (even I prefer the URL), but if the platform and user reference are used for all endpoints on the API, maybe the HTTP Header could be a reasonable place to put them.
Is there some reference about what kind of situations the HTTP Header could be used? What you guys understand about the HTTP Header use?
The request-header fields allow the client to pass additional information about the request, and about the client itself, to the server.– Dherik Mar 28 '18 at 12:52Content-typeinforming the input data format and theAcceptinforming the accepted format of the response. Or theAuthorizationinforming that an additional procedure (security) should be accounted by the system. Or the conditional headers If-Modified-Since and such. Headers impacts on the IPC itself. Most of the things informed through HTTP headers are traversals in any architecture (security, cache, message formatting,...) – Laiv Mar 28 '18 at 13:04