私は受け取っているPOSTに問題があります。私は次のエンドポイントがあります。誰かがこのURLに私にPOSTを送信するとき、今すぐ春のコンテンツタイプの問題
@RequestMapping(value = "/payment", method = POST)
public void saveOrder(@RequestBody PaymentDto paymentDto) throws RequiredFieldException, IOException, MessagingException {
//do something
}
を、私は応答して、次を得る:
{"errorMessage":"Unsupported Media Type",
"errorId":"906f5dc8-0b79-4f91-9eaa-a252e8d5ac76",
"errorDetails":
{"message":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported",
"exception":"org.springframework.web.HttpMediaTypeNotSupportedException",
"errors":null
}}
は、私はそれをどのように修正することができますか?私はそれを送信するときに私はコンテンツタイプのヘッダーを変更することはできません。それは私が制御しないサーバーから送信されます。
かもしれませんこれに重複してください:http://stackoverflow.com/questions/33796218/content-type-application-x-www-form-urlencodedcharset-utf-8-not-supported-for – Minh