Header parameters: “Accept” and “Content-type” in a REST context

后端 未结 4 454
猫巷女王i
猫巷女王i 2020-12-08 07:03

I understand that the Accept parameter define a data type expected in a client response sent from the server, so it\'s used as a response header.

My que

4条回答
  •  执念已碎
    2020-12-08 07:21

    The Accept Client Request-header field can be used to specify certain media types which are acceptable for the response.

    The Content-Type is entity-header field indicates the media type of the entity-body sent to the recipient.

    HTTP header fields provide required information about the request or response, or about the object sent in the message body. There are four types of HTTP message headers:

    • General-header: These header fields have general applicability for both request and response messages.
    • Client Request-header: These header fields have applicability only for request messages.
    • Server Response-header: These header fields have applicability only for response messages.
    • Entity-header: These header fields define meta information about the entity-body or, if no body is present, about the resource identified by the request. Source

    https://www.w3.org/Protocols/HTTP/HTRQ_Headers.html
    https://www.w3.org/Protocols/HTTP/Object_Headers.html

提交回复
热议问题