HTTP issues finishing

https://www.cnblogs.com/haonanZhang/p/6362233.html

https://www.cnblogs.com/cbslock/p/10139160.html

https://www.cnblogs.com/yoyoketang/p/10137927.html

 

First, a complete page url to load from the input, through the middle of something.

1, first of all, enter the url in the browser address bar. Url address to resolve the legality

2, browser to view the browser cache - System Cache - router cache, the cache if there is, it will directly display the page on the screen. If not, the operation jumps to the third step

  • Browser cache : Browsers DNS record for some time, therefore, only the first place to resolve DNS requests;
  • Operating system cache: If you do not include this record in the browser cache, the system will call the operating system, access to records of the operating system (saves the last DNS query cache);
  • Router cache : If the above two steps do not successfully obtain DNS records, continue to search for the router cache;
  • ISP cache: If the above fails, continue to search ISP.

3, before sending http request, require domain name resolution (DNS parsing) (DNS (Domain Name System, Domain Name System) is a core service of the Internet, it can be used as a distributed database of domain names and IP addresses mapped each other, can make more convenient access to the Internet, without having to remember the IP address.) , resolved to obtain the corresponding IP address

4, the browser initiates a server tcp connection established with the browser tcp three-way handshake (TCP namely Transmission Control Protocol .TCP Internet connection is a connection protocol suite)

5, after the handshake is successful, the browser sends to the server http request, the request packet

6, the server processes the request received request, the data is returned to the browser

7, browser receives the HTTP response

8, the browser parses the response. If the response can be cached, stored to the cache.

9, the browser sends a request for access to resources (html, css, JavaScript, images, music, etc.) embedded in HTML, for an unknown type, the dialog box will pop up

10, ajax query ( page asynchronous loading technology ), send an asynchronous request.

11, page rendering is complete

 

DNS: DNS service translates host names to IP addresses. Such as converting http://www.cnblogs.com/ host name to an IP address: 211.137.51.78 

 

Second, the difference between get and post

See get / post comparison

 

Third, the difference between cookies and session mechanisms mechanisms

1, Cookies data stored in the client. session data is stored on the server

2, cookies can relieve pressure on the server, but secure, easy to deceive cookies

3, the session a little safer, but take up server resources.

 

Four, http status codes

  • 200 请求已成功,请求所希望的响应头或数据体将随此响应返回。
  • 201 请求已经被实现,而且有一个新的资源已经依据请求的需要而建立,且其 URI 已经随Location 头信息返回
  • 202 服务器已接受请求,但尚未处理
  • 301 (永久移动) 请求的网页已永久移动到新位置。 服务器返回此响应(对 GET 或 HEAD 请求的响应)时,会自动将请求者转到新位置。
  • 302 (临时移动) 服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求。
  • 303 (查看其他位置) 请求者应当对不同的位置使用单独的 GET 请求来检索响应时,服务器返回此代码。
  • 304 (未修改) 自从上次请求后,请求的网页未修改过。 服务器返回此响应时,不会返回网页内容。
  • 305 (使用代理) 请求者只能使用代理访问请求的网页。 如果服务器返回此响应,还表示请求者应使用代理。
  • 307 (临时重定向) 服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求。
  • 400 请求失败,请求希望得到的资源违背在服务器发现。(只要不是新手写的demo,一般404都是你路径写错了,或者未区分大小写啥的)
  • 401 当前请求需要用户验证。如果当前请求已经包含了 Authorization 证书,那么401响应代表着服务器验证已经拒绝了那些证书
  • 403 服务器已经理解请求,但是拒绝执行它。与401响应不同的是,身份验证并不能提供任何帮助,而且这个请求也不应该被重复提交
  • 404 请求失败,请求所希望得到的资源未被在服务器上发现
  • 500 服务器遇到了一个未曾预料的状况,导致了它无法完成对请求的处理。一般来说,这个问题都会在服务器的程序码出错时出现。
  • 501 服务器不支持当前请求所需要的某个功能。当服务器无法识别请求的方法,并且无法支持其对任何资源的请求。
  • 502 作为网关或者代理工作的服务器尝试执行请求时,从上游服务器接收到无效的响应。
  • 503 由于临时的服务器维护或者过载,服务器当前无法处理请求。这个状况是临时的,并且将在一段时间以后恢复。

 

五、http协议请求方式

GET、POST和 HEAD方、OPTIONS, PUT, DELETE, TRACE 和 CONNECT 方法。

 

六、httphttps区别

HTTPS = HTTP + SSL

1、https有ca证书,http一般没有

2、http是超文本传输协议,信息是明文传输。https则是具有安全性的ssl加密传输协议

3、http和https使用的是完全不同的连接方式,用的端口也不一样,前者是80,后者是443(这个只是默认端口不一样,实际上端口是可以改的)

4、http的连接很简单,是无状态的;HTTPS协议是由SSL+HTTP协议构建的可进行加密传输、身份认证的网络协议,比http协议安全。

 

七、HTTP请求报文与响应报文格式

请求报文包含三部分:
a、请求行:包含请求方法、URI、HTTP版本信息
b、请求头部(headers)字段
c、请求内容实体(body)
响应报文包含三部分:
a、状态行:包含HTTP版本、状态码、状态码的原因短语
b、响应头部(headers)字段
c、响应内容(body)实体

 

八、什么是Http协议无状态协议?怎么解决Http协议无状态协议?

1、无状态协议对于事务处理没有记忆能力。缺少状态意味着如果后续处理需要前面的信息
2、无状态协议解决办法: 通过1、Cookie 2、通过Session会话保存。

Guess you like

Origin www.cnblogs.com/shengyin/p/12176251.html