调用第三方接口时报错status\":415,\"error\":\"Unsupported Media Type\\
时间: 2023-08-22 19:04:53 浏览: 88
运行报错:Error: error:0308010C:digital envelope routines::unsupporte
根据提供的引用内容,这些报错的原因是不支持的内容类型。错误码415表示不支持内容类型。主要原因是没有正确设置内容类型标头。在POST请求中,如果使用Body传参,需要在Headers里添加正确的内容类型配置。例如,"Content-Type": "application/json"。在第一个引用中,报错的内容类型为"text/plain;charset=UTF-8",在第二个引用中,报错的内容类型为"application/octet-stream"。要解决这个问题,你需要在发送请求时正确设置Headers中的"Content-Type"字段为正确的内容类型。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [POST请求报错:"status": 415, "error": "Unsupported Media Type", "message": "Content type 'app](https://blog.csdn.net/weixin_41890247/article/details/100143958)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Python requests post 请求报错:‘status‘: 415, ‘error‘: ‘Unsupported Media Type](https://blog.csdn.net/weixin_47481102/article/details/130971407)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文