最近在研究jmeter測試接口,于是決定用fiddler抓取接口參數(shù),找了最基本的一個登陸接口,可發(fā)現(xiàn)請求url太多了,不知道哪一個是自己需要的,最后找到了url,卻發(fā)現(xiàn)沒有請求參數(shù),于是,參考網(wǎng)上種種資料,問題迎刃而解,分享出來,給有需要幫助的朋友
這里要先說說一個概念
- 常見的post提交數(shù)據(jù)類型有:
1.第一種:application/json;格式:{"input1":"xxx","input2":"ooo","remember":false}
2.第二種:application/x-www-form-urlencoded ,格式:input1=xxx&input2=ooo&remember=false
3.第三種:multipart/form-data
格式:
------WebKitFormBoundaryrGKCBY7qhFd3TrwA
Content-Disposition: form-data; name="text"
title
------WebKitFormBoundaryrGKCBY7qhFd3TrwA
Content-Disposition: form-data; name="file"; filename="chrome.png"
4.第四種:text/xml
1)假如:請求Content-Type為Content-Type: application/json
那么,可在Inspector下的JSON直接看參數(shù),更直觀,這里我用163郵箱登陸為例,如下圖

2)假如:請求Content-Type為Content-Type:application/x-www-form-urlencoded
在Raw下查看參數(shù),如下圖:

那么,在Inspector-WebForms下,直接查看表單參數(shù),更直觀

注意:這里的QueryString是請求參數(shù)
問題來了,如果Content-Type: application/json類型在WebForms中查看,就會發(fā)現(xiàn)在body中找不到參數(shù),原因是Content-Type: application/json類型需要去josn中查看參數(shù),如下圖所示:

以上就是fiddler抓包過程,找不到body參數(shù)的可能原因~~