简体   繁体   English

"status":415, "status":"UNSUPPORTED_MEDIA_TYPE","message":"内容类型 'application/x-www-form-urlencoded;charset=UTF-8' 不支持

[英]"status":415, "status":"UNSUPPORTED_MEDIA_TYPE","message":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

I'm using Curl to call json API with following as:我正在使用 Curl 调用 json API ,如下所示:

curl -i -k -X POST -H "Content-Type: application/json" -d "{\"niceSessionKey\": \"S202320220722145915340287\",\"fiCode\": \"B100000022\",\"taskCode\": \"KYC_VC2_RSLT\",\"appNumber\": \"APPL000000000000999\",\"customerNumber\": \"12345678\",\"mobilePhoneNumber\": \"0966688526\"}" https://100.113.125.128:8080/api/KYT_VC7_RSLT

But when i run it return result from server following as:但是当我运行它时,它从服务器返回结果如下:

"status":"UNSUPPORTED_MEDIA_TYPE","message":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported","errors":["application/x-www-form-urlencoded;charset=UTF-8 media type is not supported. Supported media types are application/octet-stream, text/plain, application/xml, text/xml, application/x-www-form-urlencoded, application/*+xml, multipart/form-data, application/json, application/*+json, */*"]}

I have set Content-Type is application/json, but i don't why it still return get result error.我已将 Content-Type 设置为 application/json,但我不明白为什么它仍然返回 get result 错误。 How to fix the problem?如何解决问题?

try this:尝试这个:

    @PostMapping(
  path = "/web/feedback",
  consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE})

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 内容类型 'application/x-www-form-urlencoded;charset=UTF-8' 不支持 - Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported Spring Boot - 不支持内容类型“application/x-www-form-urlencoded;charset=UTF-8” - Spring Boot - Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported HttpMediaTypeNotSupportedException:不支持内容类型 'application/x-www-form-urlencoded;charset=UTF-8' - HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported restcontroller和application / x-www-form-urlencoded; charset = UTF-8媒体类型的问题 - Issue with restcontroller and application/x-www-form-urlencoded;charset=UTF-8 media type 使用消息“ message”测试Post API时获得415状态代码:“内容类型'text / plain; charset = UTF-8'不支持” - Getting 415 status code while testing a Post API with the message “message”: “Content type 'text/plain;charset=UTF-8' not supported” 使用Mailgun发送电子邮件-找不到Java类型FormDataMultiPart和MIME媒体类型application / x-www-form-urlencoded的消息正文编写器 - Sending email with Mailgun - a message body writer for Java type FormDataMultiPart and MIME media type application/x-www-form-urlencoded was not found 如何使用application / x-www-form-urlencoded运行jmeter请求; charset = UTF-8“(像邮差的)设置 - How to run jmeter requests with application/x-www-form-urlencoded; charset=UTF-8" (like postman's) setting Jersey异常:找不到用于Java类和MIME媒体类型application / x-www-form-urlencoded的消息正文阅读器 - Jersey Exception : A message body reader for Java class and MIME media type application/x-www-form-urlencoded was not found 发生意外错误(类型=不支持的介质类型,状态= 415)。 不支持内容类型“空” - There was an unexpected error (type=Unsupported Media Type, status=415). Content type 'null' not supported AWS SNS http 订阅返回“不支持的媒体类型:不支持内容类型‘text/plain;charset=UTF-8’” - AWS SNS http suscription return "Unsupported Media Type: Content type 'text/plain;charset=UTF-8' not supported"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM