Network-CheatSheet
HTTP CheatSheet | HTTP 相关必知必会:TCP/HTTP2/HTTPS/DNS,请求,响应,缓存
http://rob:abcd1234@www.example.co.uk/path/index.html?query1=test&silly=willy&field[0]=zero&field[2]=two#test=hash&chucky=cheese
基础
URI & URL
The difference between them is straightforward after knowing their definitions:
- Uniform Resource Identifier (URI) − a sequence of characters that allows the complete identification of any abstract or physical resource
- Uniform Resource Locator (URL) − a subset of URI that, in addition to identifying where a resource is available, describes the primary mechanism to access it
Every URI, regardless if it’s a URL or not, follows a particular form:
scheme:[//authority][/path][?query][#fragment]
Where each part is described as follows:
- *scheme* − for URLs, is the name of the protocol used to access the resource, for other URIs, is a name that refers to a specification for assigning identifiers within that scheme
- authority − an optional part comprised of user authentication information, a host and an optional port
- *path* − it serves to identify a resource within the scope of its scheme and authority
- *query* − additional data that, along with the path, serves to identify a resource. For URLs, this is the query string
- *fragment* − an optional identifier to a specific part of the resource
To easily identify if a particular URI is also a URL, we can check its scheme. Every URL has to start with any of these schemes: ftp, http, https, gopher, mailto, news, nntp, telnet, wais, file, or prospero. If it doesn’t start with it, then it’s not a URL.
请求
响应
常用响应头
- Content-Disposition
Content-Type: image/jpeg
Content-Disposition: inline;filename=hello.jpg
Content-Description: just a small picture of me
缓存
TCP

这是因为
CLOSED | 没有使用这个套接字 |
---|---|
LISTEN | 套接字正在监听连接 |
SYN_SENT | 套接字正在试图主动建立连接 |
SYN_RECEIVED | 正在处于连接的初始同步状态 |
ESTABLISHED | 连接已建立 |
CLOSE_WAIT | 远程套接字已经关闭:正在等待关闭这个套接字 |
FIN_WAIT_1 | 套接字已关闭,正在关闭连接 |
CLOSING | 套接字已关闭,远程套接字正在关闭,暂时挂起关闭确认 |
LAST_ACK | 远程套接字已关闭,正在等待本地套接字的关闭确认 |
FIN_WAIT_2 | 套接字已关闭,正在等待远程套接字关闭 |
TIME_WAIT | 这个套接字已经关闭,正在等待远程套接字的关闭传送 |
HTTPS


HTTP/2
WebSocket
DNS
比如所有”.alipay.com”结尾的域名都由
所有”.alibaba.com”结尾的域名都由
所有“.baidu.com”结尾的域名都由

递归
那用户访问 www.alibaba.com,请求又是如何到
这个时候递归
有的