PUT
HTTP PUT 請求主要是從客戶端向服務器傳送的數(shù)據(jù)取代指定的文檔的內容。
PUT請求可以使用Query String Parameters以及body請求體將參數(shù)傳遞給服務器。
案例:
發(fā)送PUT請求唠倦,并傳遞字符參數(shù)“hello”
返回值:
{
"args": {},
"data": "hello",
"files": {},
"form": {},
"headers": {
"x-forwarded-proto": "http",
"x-forwarded-port": "80",
"host": "postman-echo.com",
"x-amzn-trace-id": "Root=1-601ab16a-7f44c6085fa320922d18e57e",
"content-length": "5",
"content-type": "text/plain",
"user-agent": "PostmanRuntime/7.23.0",
"accept": "*/*",
"cache-control": "no-cache",
"postman-token": "8c4a82ba-db7c-4d83-bc26-7011e7a17669",
"accept-encoding": "gzip, deflate, br",
"cookie": "sails.sid=s%3AfkqMPBl_jApZ6wKUgs-5loXXWbk2jErB.qhhBQk4E3IOok3Bt9EKmzfPJcYgwdHjE%2BCY%2BnvYmiZY"
},
"json": null,
"url": "http://postman-echo.com/put"
}
DELETE
HTTP DELETE方法用于刪除服務器上的資源及刻,DELETE請求可以使用Query String Parameters 以及body請求體將參數(shù)傳遞給服務器特幔。
https://postman-echo.com/delete
返回值:
{
"args": {},
"data": {},
"files": {},
"form": {},
"headers": {
"x-forwarded-proto": "http",
"x-forwarded-port": "80",
"host": "postman-echo.com",
"x-amzn-trace-id": "Root=1-601ab260-1c3dc8982931cdf6605ed90e",
"content-length": "0",
"user-agent": "PostmanRuntime/7.23.0",
"accept": "*/*",
"cache-control": "no-cache",
"postman-token": "c947d90a-8e79-48d5-9395-c8405e192e75",
"accept-encoding": "gzip, deflate, br",
"cookie": "sails.sid=s%3AfkqMPBl_jApZ6wKUgs-5loXXWbk2jErB.qhhBQk4E3IOok3Bt9EKmzfPJcYgwdHjE%2BCY%2BnvYmiZY"
},
"json": null,
"url": "http://postman-echo.com/delete"
}
Request Header
Request Header(請求頭)用來說明服務器要使用的附加信息淳衙,比較重要的信息有Cookie巢寡、Referer蓬戚、User-Agent等夸楣。在Postman中可以在請求下方的Headers欄目來設置,如下圖所示:
Response Header
Response Header(響應頭)其中包含了服務器對請求的應答信息子漩,如Content-Type豫喧、Server、Set-Cookie等幢泼,在Postman主界面下方Headers或者Postman Console界面都可以查看Response Header信息紧显。
Tips:通過Postman Console也可以看到每次請求的Request Header詳細信息