fillder手动发送post请求的两种方式

使用springMVC框架,controller类post方法接收实体bean对象参数时常用两种方式@RequestBody和@ModelAttribute:

1、参数前为:@RequestBody

fiddler配置:

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: 44

Request Body:

{"mobile":"xxxxxxxxxxx","password":"123456"}

2、参数前为:@ModelAttribute

fiddler配置:

POST请求头:

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

 

posted @ 2018-11-29 10:57  Mr.攻城师  阅读(675)  评论(0)    收藏  举报