[英]"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.