Specify supported media types when sending “415 unsupported media type”

后端 未结 4 528
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-11 11:26

If a clients sends data in an unsupported media type to a HTTP server, the server answers with status \"415 unsupported media type\". But how to tell the client what media t

4条回答
  •  感情败类
    2021-01-11 11:51

    In his book "HTTP Developer's Handbook" on page 81 Chris Shiflett explains what a 415 means, and then he says, "The media type used in the content of the HTTP response should be indicated in the Content-Type entity header."

    1) So is Content-Type a possible answer? It would presumably be a comma-separated list of accepted content types. The obvious problem with this possibility is that Content-Type is an entity header not a response header.

    2) Or is this a typo in the book? Did he really mean to say "the HTTP request"?

提交回复
热议问题