HTTP:各种method的请求头和响应报文

各种HTTP method的请求头和响应报文的例子,供以后参考。

目录

一、OPTIONS

二、HEAD/GET

三、TRACE

四、DELETE

五、PUT


一、OPTIONS

request:

OPTIONS /boeing/headerServlet HTTP/1.1
Host: 127.0.0.1:8000

 response:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Allow: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS
Content-Length: 0
Date: Mon, 16 May 2011 10:47:32 GMT

二、HEAD/GET

request:

HEAD /boeing/headerServlet HTTP/1.1
Host: 127.0.0.1:8000

GET /boeing/headerServlet HTTP/1.1
Host: 127.0.0.1:8000

 response: 

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: testCookie=book; Path=/pp/ll
Content-Length: 0
Date: Mon, 16 May 2011 10:56:37 GMT

三、TRACE

request: 

TRACE /boeing/headerServlet HTTP/1.1
Host: 127.0.0.1:8000

 response:  

HTTP/1.1 405 Method Not Allowed
Server: Apache-Coyote/1.1
Allow: POST, GET, DELETE, OPTIONS, PUT, HEAD
Content-Length: 0
Date: Mon, 16 May 2011 10:57:50 GMT

四、DELETE

request: 

DELETE /boeing/test.html HTTP/1.1
Host: 127.0.0.1:8000

 response:  

HTTP/1.1 204 No Content
Server: Apache-Coyote/1.1
Date: Mon, 16 May 2011 11:06:09 GMT

五、PUT

生成test.html 内容是ddddddd

request: 

PUT /boeing/test.html HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 7

ddddddd

 response: 

HTTP/1.1 204 No Content
Server: Apache-Coyote/1.1
Date: Mon, 16 May 2011 11:09:45 GMT

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值