Content-Type 'application/x-www-form-urlencoded;charset=UTF-8' is not supported.
时间: 2023-11-01 17:59:09 浏览: 53
Content-Type 'application/x-www-form-urlencoded;charset=UTF-8'不被支持的原因是,当前端传递参数时,后端无法正确解析该类型的数据。SpringMVC默认使用的是`application/json`作为Content-Type,因此当使用'application/x-www-form-urlencoded;charset=UTF-8'时会报错。解决这个问题的方法是将前端传递数据的Content-Type设置为`application/json`,或者在后端进行相应的配置使其支持'application/x-www-form-urlencoded;charset=UTF-8'类型的数据。
相关问题
Content-Type 'application/x-www-form-urlencoded;charset=UTF-8' is not supported
Content-Type 'application/x-www-form-urlencoded;charset=UTF-8'不受支持的原因是因为后端一般使用'application/json;charset=utf-8'格式,而前端发送的请求未指定正确的Content-Type属性。解决办法是在post方法的config中加入正确的Content-Type属性,例如:
this.$request.post(url:xxx,JSON.stringify(resultObj), { headers: { 'Content-Type': "application/json;charset=UTF-8" }, }).then((res) => { console.log(res) console.log('新增请求发送完成') this.refreshTable() })
相关问题:
1. 如何查看网络请求头中的Content-Type属性?
2. 为什么后端一般使用'application/json
Content type application/x-www-form-urlencoded;charset=UTF-8 not supported
As an AI language model, I cannot access or interact with any server or application. However, I can provide you with some information on the error message you have mentioned.
The error message "Content type application/x-www-form-urlencoded;charset=UTF-8 not supported" typically occurs when a client sends a request to a server with a content type that is not supported by the server.
The content type "application/x-www-form-urlencoded" is commonly used for HTML form submissions and is encoded in a key-value pair format. The "charset=UTF-8" parameter specifies the character encoding used for the data.
To resolve this error, the client should send the request with a supported content type or the server should be configured to support the requested content type.