一:HTTP的请求方式
image.png二:HTTP响应状态码
image.pngimage.png
可以通过这个命令查看响应状态码
curl -I -s -w "%{http_code}\n" -o /dev/null www.baidu.com
三:HTTP请求报文
image.png四:HTTP响应报文
image.png五:使用命令查看客户端和服务器端之间的响应过程
[root@web01 ~]# curl -v www.baidu.com/index.html
* About to connect() to www.baidu.com port 80 (#0) \\DNS解析
* Trying 39.156.66.14...
* Connected to www.baidu.com (39.156.66.14) port 80 (#0) \\Tcp三次握手
> GET /index.html HTTP/1.1 \\http请求报文 ,请求起始行
> User-Agent: curl/7.29.0 \\用户的浏览器
> Host: www.baidu.com \\请求域名
> Accept: */*
> \\空行
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
< Connection: Keep-Alive
< Content-Length: 2381
< Content-Type: text/html
< Date: Mon, 03 Jun 2019 03:32:03 GMT
< Etag: "588604c8-94d"
< Last-Modified: Mon, 23 Jan 2017 13:27:36 GMT
< Pragma: no-cache
< Server: bfe/1.0.8.18
< Set-Cookie: BDORZ=27315; max-age=86400; domain=.baidu.com; path=/
<
<!DOCTYPE html>
<!--STATUS OK--><html> <head><meta http-equiv=content-type
content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible
content=IE=Edge><meta content=always name=referrer><link rel=stylesheet
type=text/css href=http://s1.bdstatic.com/r/www/cache/bdorz/baidu.min.css><title>
百度一下,你就知道</title></head> <body link=#0000cc> <div id=wrapper> <div
网友评论