Request/Response

作者: 宝宝丶菲 | 来源:发表于2018-04-16 17:36 被阅读0次

Http请求中Content-Type详解

Accept=application/json

服务器根据请求头“Accept=application/json”生产json数据。

当你有如下Accept头,将遵守如下规则进行应用:

①Accept:text/html,application/xml,application/json

将按照如下顺序进行produces的匹配 ①text/html ②application/xml ③application/json

②Accept:application/xml;q=0.5,application/json;q=0.9,text/html

将按照如下顺序进行produces的匹配 ①text/html ②application/json ③application/xml

参数为媒体类型的质量因子,越大则优先权越高(从0到1)

③Accept:*/*,text/*,text/html

将按照如下顺序进行produces的匹配 ①text/html ②text/* ③*/*

即匹配规则为:最明确的优先匹配。

Requests部分:


Responses 部分:

相关文章

网友评论

    本文标题:Request/Response

    本文链接:https://www.haomeiwen.com/subject/aebekftx.html