天天看點

org.springframework.web.HttpMediaTypeNotSupportedException: Unsupported Media Type, status=415java.io.IOException: Server returned HTTP response code: 415 for URL:xxxxxx

org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'null' not supported

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Jan 04 17:33:41 CST 2018

There was an unexpected error (type=Unsupported Media Type, status=415).

Content type 'null' not supported

産生錯誤的代碼:

其實問題的關鍵就是:

中的“

把這個參數去掉就可以了。通路結果如下:

org.springframework.web.HttpMediaTypeNotSupportedException: Unsupported Media Type, status=415java.io.IOException: Server returned HTTP response code: 415 for URL:xxxxxx

 上面去掉的參數什麼意思呢?

其實是要求用戶端調用的時候,以 

格式送出參數資料。

參考: 

另見下面的 AJAX 調用示例:

指定:

org.springframework.web.HttpMediaTypeNotSupportedException: Unsupported Media Type, status=415java.io.IOException: Server returned HTTP response code: 415 for URL:xxxxxx

繼續閱讀