wget-理解 HTTP 请求大致过程

访问 http

root@aliyun:~# wget http://www.zhihu.com
–2020-08-28 08:36:22-- http://www.zhihu.com/
Resolving www.zhihu.com (www.zhihu.com)... 42.81.92.60, 42.81.85.241 (1) dns 解析
Connecting to www.zhihu.com (www.zhihu.com)``|42.81.92.60|:80… connected.(2) 建立连接
HTTP request sent, awaiting response…(3) 发起 HTTP 请求
302 Found(4) 发起 HTTP 状态码 302 重定向
Location: https://www.zhihu.com/ [following]
–2020-08-28 08:36:22-- https://www.zhihu.com/
Connecting to www.zhihu.com (www.zhihu.com)|42.81.92.60|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: //www.zhihu.com/signin?next=%2F [following]
–2020-08-28 08:36:22-- https://www.zhihu.com/signin?next=%2F
Reusing existing connection to www.zhihu.com:443.
HTTP request sent, awaiting response… 200 OK
Length: 50811 (50K) [text/html]
Saving to: ‘index.html’

index.html 100%[=================================>] 49.62K --.-KB/s in 0.007s

2020-08-28 08:36:22 (6.61 MB/s) - ‘index.html’ saved [50811/50811]

访问 https

root@aliyun:~# wget https://www.zhihu.com
–2020-08-31 16:41:14-- https://www.zhihu.com/
Resolving www.zhihu.com (www.zhihu.com)42.81.85.241, 42.81.92.60
Connecting to www.zhihu.com (www.zhihu.com)|42.81.85.241|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: //www.zhihu.com/signin?next=%2F [following]
–2020-08-31 16:41:14-- https://www.zhihu.com/signin?next=%2F
Reusing existing connection to www.zhihu.com:443.
HTTP request sent, awaiting response… 200 OK
Length: 51048 (50K) [text/html]
Saving to: ‘index.html’

index.html 100%[=======================>] 49.85K --.-KB/s in 0.006s

2020-08-31 16:41:14 (7.71 MB/s) - ‘index.html’ saved [51048/51048]

总结

第一步进行域名解析,拿到 IP 地址。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值