application/json 与 application/x-www-form-urlencoded的比较
application/json 与 application/x-www-form-urlencoded的比较 application/x-www-form-urlencoded 提交请求示例 curl -X POST 'http://localhost:8080/formPost' -d 'id=1&name=foo&mobile=13612345678' wireshark抓包结果 对应的服务端解析参数源码 //org.springframework.web.method.annotation.RequestParamMethodArgumentResolver #resolveName if ( arg == null ) { String[] paramValues = webRequest.getParameterValues(name); if (paramValues != null ) { arg = paramValues. length == 1 ? paramValues[ 0 ] : paramValues; } } application/json 提交请求示例 curl -X POST -H "Content-Type: application/json" 'http://localhost:8080/jsonPost' -d '{" id ":2,"