{"errorMessage":"Content-Type 'text/plain;charset=UTF-8' is not supported","errorCode":500}
时间: 2023-08-20 14:13:00 浏览: 272
根据引用\[1\]和引用\[2\]的内容,报错信息"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported"是因为前端传来的参数的Content-Type设置为"application/x-www-form-urlencoded;charset=UTF-8",而后端不支持这种类型的Content-Type。这种错误通常发生在前端使用POST请求时,请求的body是一个Json对象而不是表单形式的参数。根据引用\[3\]的内容,如果请求中传递的是JSON数据,并且Content-Type设置为"application/json"或"text/json",那么在JAVA中使用request.getParameter("")是无法获取到数据的。所以,根据报错信息"Content-Type 'text/plain;charset=UTF-8' is not supported",可能是前端设置了错误的Content-Type导致后端无法正确解析请求的数据。
#### 引用[.reference_title]
- *1* [关于出现“Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported“问题如何解决](https://blog.csdn.net/LoveTrainHY/article/details/122405744)[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^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported](https://blog.csdn.net/qq_42859450/article/details/122585906)[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^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文