springmvc 处理content-Type不是application/x-www-form-urlencoded编码的内容

 

@RequestBody

该注解常用来处理Content-Type不是application/json, application/xml等操作;

它是通过使用HandlerAdapter 配置的HttpMessageConverters来解析post data body,然后绑定到相应的bean上的。

因为配置有FormHttpMessageConverter,所以也可以用来处理 application/x-www-form-urlencoded的内容,处理完的结果放在一个MultiValueMap<String, String>里,这种情况在某些特殊需求下使用,详情查看FormHttpMessageConverter api;

posted @ 2018-07-18 15:11  陶朱公Boy  阅读(527)  评论(0编辑  收藏  举报