http
hyper text transfer protocol 超级文本传输协议
url
Uniform Resource Locator 统一资源定位
一个url,比如www.baidu.com/s?wd=hello&… ,包括:协议,域名,路径,参数,锚点
dns
Domain Name System 域名服务器
nslookup可以查询域名对应的IP地址
nslookup baidu.com
ip
Internet Protocol
ping命令可以判断本地与指定域名/ip地址连接情况
ping baidu.com
域名
域名是网络ip地址的别名
以www.baidu.com为例
com是顶级域名
baidu是俗称的一级域名
www是俗称的二级域名
http请求工具: curl,向服务器发送请求
相比浏览器,curl更直接单纯,适合于开发时使用
curl -v baidu.com // 这条命令会返回我们请求的详细数据等,以及百度希望我们访问的域名,www.baidu.com
curl -s -v www.baidu.com
curl会看到请求的详细命令
> GET / HTTP/1.1
> Host: baidu.com
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sat, 12 Mar 2022 08:14:30 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: Sun, 13 Mar 2022 08:14:30 GMT
< Connection: Keep-Alive
< Content-Type: text/html
<
http请求时的数据格式和返回时的数据格式,就是http协议