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

 

转载于:https://www.cnblogs.com/front-end-develop/p/10036942.html