我目前正在使用请求库传入标题。
我相信文档说明某些事件优先于自定义标题。
有没有办法让您的自定义标题优先?
例如,我想要content-type
'application/vnd.reviewboard.org.diff.data+json'
。
但是,响应继续表明不同的标题:
requests.get('url_here', headers={'content-type':'application/vnd.reviewboard.org.diff.data+json'}).__dict__
将返回
'content-type': 'application/vnd.reviewboard.org.file+json'
如果相关,我正试图点击审核委员会的终端
https://www.reviewboard.org/docs/manual/2.5/webapi/2.0/resources/file-diff/
答案 0 :(得分:1)
您似乎正在尝试指定在响应中收到的内容类型,而不是您的请求的内容类型。因此,您应该使用Accept
标题,而不是content-type
。