Postman请求发送—PUT&DELETE

PUT

HTTP PUT 请求主要是从客户端向服务器传送的数据取代指定的文档的内容。

PUT请求可以使用Query String Parameters以及body请求体将参数传递给服务器。

案例:

发送PUT请求,并传递字符参数“hello”

image.jpeg

https://postman-echo.com/put

返回值:

{

"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请求体将参数传递给服务器。

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栏目来设置,如下图所示:

image.jpeg

Response Header

Response Header(响应头)其中包含了服务器对请求的应答信息,如Content-Type、Server、Set-Cookie等,在Postman主界面下方Headers或者Postman Console界面都可以查看Response Header信息。

image.jpeg
image.jpeg

Tips:通过Postman Console也可以看到每次请求的Request Header详细信息

你可能感兴趣的:(Postman请求发送—PUT&DELETE)