curl -XGET http://baidu.com和 curl -XPOST http://baidu.com的Tcp流区别。

jackxiang 2017-6-24 12:35 | |
内容:
curl -XGET http://baidu.com

GET / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*

HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:56:42 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:56:42 GMT
Connection: Keep-Alive
Content-Type: text/html

<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>



curl -XPOST http://baidu.com


POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*

HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 03:59:50 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 03:59:50 GMT
Connection: Keep-Alive
Content-Type: text/html

<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>



Post加个参数:
curl -XPOST http://baidu.com -d'say=hello'

POST / HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*
Content-Length: 9
Content-Type: application/x-www-form-urlencoded

say=helloHTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:03:47 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:03:47 GMT
Connection: Keep-Alive
Content-Type: text/html

<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>



Get里加个参数:
curl -XGET http://baidu.com?say=hello

GET /?say=hello HTTP/1.1
User-Agent: curl/7.29.0
Host: baidu.com
Accept: */*

HTTP/1.1 200 OK
Date: Fri, 31 Mar 2017 04:05:06 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: '51-47cf7e6ee8400'
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Sat, 01 Apr 2017 04:05:06 GMT
Connection: Keep-Alive
Content-Type: text/html

<html>
<meta http-equiv='refresh' content='0;url=http://www.baidu.com/'>
</html>

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/9250/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]