this.$http.sendRequest('partyOpenApi/edit', 'put', this.form).then(res => { debugger //成功回调 this.is_Update = true })报错请求地址'/partyOpenApi/edit',发生系统异常. org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported 怎样解决
时间: 2024-04-18 08:28:25 浏览: 14
您遇到的问题是请求地址'/partyOpenApi/edit'发生了系统异常,具体错误是`org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported`。这个错误通常是由于请求头中的Content-Type类型不受支持引起的。
为了解决这个问题,您可以尝试以下几种方法:
1. 确保请求头中的Content-Type设置正确:根据报错信息,Content-Type应该是`application/x-www-form-urlencoded;charset=UTF-8`。请确保在发送请求时设置了正确的Content-Type头部信息。
2. 检查请求参数的格式:确认您发送的请求参数是否符合`application/x-www-form-urlencoded`格式要求。您可以使用URL编码将参数转换为适当的格式。
3. 检查服务器端的配置:可能是服务器端未正确配置导致不支持该Content-Type类型。请联系后端开发人员或服务器管理员,确认服务器是否正确配置了对`application/x-www-form-urlencoded`类型的支持。
4. 尝试修改请求方式:有时候将请求方式从'put'修改为'post'或其他适合的方式也可以解决问题。
请根据具体情况尝试以上方法,希望能够帮助到您解决问题。如果问题仍然存在,请提供更多的相关代码和错误信息,以便我们更好地帮助您解决问题。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)