fillder手動發送post請求的兩種方式

使用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

相關文章
相關標籤/搜索