springmvc application/octet-stream 問題

錯誤web

  1. 類名:org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver||行數:152||異常信息:Content type 'application/octet-stream' not supported
    spring

 源碼json

@RequestMapping("/")
@ResponseBody
public JSONObject GHCallBack(@RequestBody JSONObject body) {
    return icbcCallBackService.GHCallBackHandler(body);
}mvc

 解決方法:app

@RequestMapping("/")
@ResponseBody
public JSONObject GHCallBack(@RequestBody String body) {
    return icbcCallBackService.GHCallBackHandler(body);
}源碼

總結:servlet

application/octet-stream 是原始的二進制流方式,採用application/json + Bean接受的方式出現轉換異常,應該使用原始的String接收方式。io

相關文章
相關標籤/搜索