使用springMVC框架,controller类post方法接收实体bean对象参数时经常使用两种方式@RequestBody和@ModelAttribute:spring
一、参数前为:@RequestBodyjson
fiddler配置:app
POST请求头:框架
Content-Type: application/json
User-Agent: Fiddler
Accept-Language: zh-CN,zh;q=0.8
X-Requested-With: XMLHttpRequest
Host: localhost:8080
Content-Length: 44post
Request Body:url
{"mobile":"xxxxxxxxxxx","password":"123456"}code
二、参数前为:@ModelAttributeorm
fiddler配置:对象
POST请求头:it
Content-Type: application/x-www-form-urlencoded
User-Agent: Fiddler
Accept-Language: zh-CN,zh;q=0.8
X-Requested-With: XMLHttpRequest
Host: localhost:8080
Content-Length: 34
Request Body:
mobile=xxxxxxxxxxx&password=123456