python发送post请求发送json数据时,报415的原因和处理方法。

415   Unsupported media type. 不支持MEDIA类型 

这代表服务无法处理你提交的数据格式。

处理起来很简单,在你的header里指定一下格式。

加上一句代码

headers = {"Content-Type": "application/json"}

 

posted @ 2016-07-25 17:32  kandylove2011  阅读(2237)  评论(0编辑  收藏  举报