五百要不要报保险 requestbody和requestparam区别?

requestbody和requestparam区别?Requestbody处理httpentity传递的数据,通常用于处理非内容类型的数据:application/x-www-form-urlenc

requestbody和requestparam区别?

Requestbody

处理httpentity传递的数据,通常用于处理非内容类型的数据:application/x-www-form-urlencoded格式。

在get请求中,@requestbody不适用,因为没有httpentity。

在post请求中,通过httpentity传递的参数必须在请求头中声明数据类型content type。Spring MVC使用由

handleradapter配置的httpmessage转换器解析httpentity中的数据,然后将其绑定到相应的bean。

Requestparam

用于处理内容类型:content encoded for application/x-www-form-urlencoded。(在HTTP协议中,如果未指定内容类型,则默认情况下传递的参数是application/x-www-form-urlencoded的类型。)