客户端 http 请求报错 415,具体如下:
Server returned HTTP response code: 415 for URL: http://ip:port/xxx
服务器端 用的是 @RequestBody 接收body参数 ,看了下服务器端提示:
Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported]
根据提示 发现 客户端http请求头 Content-Type 内容是 text/plain;charset=UTF-8
让客户端 将请求头 Content-Type 内容 改为 application/json;charset=UTF-8
传参 json 内容body 参数
成功访问,不再报错 415