Custom HTTP headers : naming conventions

前端 未结 6 2288
野趣味
野趣味 2020-11-22 09:50

Several of our users have asked us to include data relative to their account in the HTTP headers of requests we send them, or even responses they get from our API.

6条回答
  •  礼貌的吻别
    2020-11-22 09:59

    The header field name registry is defined in RFC3864, and there's nothing special with "X-".

    As far as I can tell, there are no guidelines for private headers; in doubt, avoid them. Or have a look at the HTTP Extension Framework (RFC 2774).

    It would be interesting to understand more of the use case; why can't the information be added to the message body?

提交回复
热议问题