http詳解之post 2


-----------------------post請求示例----------------
#請求行
POST   https://re.csdn.net/csdnbi   HTTP/1.1

#請求頭部開始
Host: re.csdn.net         #服務器主機地址
Connection: keep-alive      #持續鏈接
Content-Length: 482      #HTTP消息實體的傳輸長度
Accept: */*          #客戶端支持數據類型
Origin: https://blog.csdn.net       #主頁地址(不包含頁面的path,只包含協議和域名)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36      #客戶端類型及版本
Content-Type: text/plain;charset=UTF-8        #body數據類型
Referer: https://blog.csdn.net/malz_zh/article/details/83061529        #完整主頁地址,代表請求是從哪一個主頁發送的請求(包含path)
Accept-Encoding: gzip, deflate, br          #客戶端支持(接受)的編碼類型,Accept爲接受支持
Accept-Language: zh-CN,zh;q=0.9        #客戶端支持的語言
Cookie: uuid_tt_dd=10_30711819110-1547456902841-223804; dc_session_id=10_1547456902841.460658; Hm_ct_6bcd52f51e9b3dce32bec4a3997715ac=6525*1*10_30711819110-1547456902841-223804; dc_tos=pqxhx0; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=1555822559,1556851220,1556852229,1556887285; Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1556887285; c-login-auto=13
#請求頭部結束json

#body
[{"headers":{"component":"enterprise","datatype":"re","version":"v1"},"body":"{\"re\":\"uid=-&ref=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3D8YQXelBUIXh6CcK1koFk-QE6RpCHXmc6h1RVAExUs8LTxXacR_Db4u3MLTYmMand6drFLjY6NCFCtg_uOb2Moa%26wd%3D%26eqid%3Df7697d2a000c1737000000065ccc3704&pid=blog&mod=popu_4&dsm=get&mtp=2&con=&ck=-&curl=https%3A%2F%2Fblog.csdn.net%2Fmalz_zh%2Farticle%2Fdetails%2F83061529&session_id=10_1547456902841.460658&x-acl-token=status_js_dkuyqthzbajmncbsb_token\"}"}]服務器


------------------------------示例結束--------------------------------------------------session


1、post方法body常見四種數據格式:
一、application/x-www-form-urlencoded(post默認的數據格式,與get方法同樣,在fiddler中Inspectors-->Webfprms中顯示)app

 

二、application/json(text/plain)curl

 


三、text/xmlpost

四、multipart/form-data(表單)ui

相關文章
相關標籤/搜索