HTTP protocol Learning essay-1

Source: Internet
Author: User

First, the HTTP protocol principle is introduced:
HTTP protocol, full name hypertext Transfer Protocol, Chinese name Hypertext Transfer Protocol
One of the important applications of HTTP is the WWW service
www, full name World Wide Web, often referred to as the Web, the Chinese translation of "www"
The default port for the WWW Service Application of the HTTP protocol is 80
Another encrypted WWW service application HTTPS has a default port of 443
Description: General Internet company, open port, only two (80 and 443)
Ii. Introduction to the principle of HTTP protocol
User access to the site process:
1) DNS service for Domain name resolution (DNS resolution principle-recursive query/iterative query)
2) client to establish network connection with Enterprise Web server (TCP three handshake process/three handshake state transition)
3) The user requests the website sends the corresponding page information---the HTTP request message sends (the client sends) the HTTP request message contains: Request start line-Request header-blank line-Request body (content)
To consider the process of detailed requests based on the site architecture hierarchy
4) The website responds to the user request, sends the corresponding page information---HTTP response message Send (server issue)
5) client to disconnect from the corporate Web server (TCP four wave/four wave state transition)
Third, the HTTP protocol request message structure:
1) Request Line:
A) Request method:
Get---Get the data content of the requested file information (get)
Post---Inform the service of the data that needs to be saved (submit)
b) Request file information:
Description: When the requested file content is not specified, the default request is the home file index.html
c) Description of what HTTP protocol version is used for the request message
HTTP protocol Release Notes
1.0: Specifies that the browser and the server only maintain a brief connection (TCP short connection)
1.1: Specifies that the browser and the server only maintain a long-term connection (TCP long connection)
2) Request Header content:
d) Blank line
e) Request the main content:
Description: When the Get method is used, there is no request for the principal content; When the Post method is used, the information to be submitted is placed in the request body.
Four, HTTP response message structure:
1) Starting Line:
A) HTTP protocol version
HTTP protocol Release Notes
1.0: Specifies that the browser and the server only maintain a brief connection (TCP short connection)
1.1: Specifies that the browser and the server only maintain a long-term connection (TCP long connection)
b) HTTP response Status Code information
Tell the result of the request
---Normal response request message
301---jump, permanent jump
302---jump, temporary jump
403---Set the specified page to deny access; * * * * There is another situation??? )
404---Can't find the file I want to request (unable to find the requested page information)
---a problem with the back-end server of the website (most of it is a site problem)
Description: Learn more about many HTTP status codes, HTTP authoritative guide
c) HTTP Status description information
The Curl command allows you to simulate browser functionality in a Linux system, access the website
-I---Display response message start line and response header information

2) 响应头部:     d) 空行    e) 响应报文主体:        说明:就是请求报文中,所要请求文件的内容;客户端浏览器会识别响应报文主体内容,进行解析  

Five, the following is the Linux 2 ways to view:
Curl-v www.baidu.com <-Use the-v parameter of the Curl command to view Access site request and response information
wget--debug www.baidu.com <-Use the wget parameter of the--debug command to view Access site request and response information

Vi. Introduction of HTTP terminology
1) Types of media resources
Description: Defines the type of file resource that the corresponding Web service can recognize;
? If there is a corresponding request file type in the media resource type, it will help you to parse
? If the media resource type does not respond to the request file type, the file is transferred to the client and resolves itself

 2)URL与URI概念介绍  URL,全称为Uniform Resource Location,中文翻译为统一资源定位符    URI,全称为Uniform Resource Identifier,中文翻译为统一资源标识符  https://search.jd.com     /     Search?keyword=10tb&enc=utf-8&suggest=3.his.0         URL                                                               URI 3) 静态网页资源  纯粹HTML格式的网页(可以包含图片、视频JS(前端功能实现)、CSS(样式)等)通常被称为“静态网页”  特征说明:  a)每个页面都有一个固定的URL地址,且URL一般以.html、.htm、.shtml等常见形式为后缀,     而且地址中不含有问号“?”或“&”等特殊符号。  b)静态网页是实实在在保存在服务器上的文件实体,每个网页都是一个独立的文件  c)静态资源不需要和数据库进行交互,因此网站交互性能差  d)网页内容是固定不变的,因此,容易被搜索引擎收录(容易被用户找到)(优点)  e)网页程序在用户浏览器端解析,当客户端向服务器请求数据时,        服务器会直接从磁盘文件系统上返回数据(不做任何解析)

4) Dynamic Web Resources
The so-called Dynamic Web page is relative to the static Web page, that is, the URL suffix of the Dynamic Web page is not. Common extension forms for static Web pages such as HTML,. htm,. xml,. shtml,. js,. CSS, etc.
Feature description
A) dynamic resources need to interact with the database, so the site interactive performance is good
b) The Web application is resolved on the server side, and when the client requests data from the
The server will return data directly from the disk file system (which will be returned after parsing the data)

5) pseudo-static resources (understanding/real-business developers are responsible for pseudo-static resources written)
A) The content of the webpage is fixed, so it is easy to be indexed by search engine

   b) 网页程序在用户浏览器端解析,当客户端向服务器请求数据时,            服务器会直接从磁盘文件系统上返回数据(不做任何解析)   c) 动态资源需要和数据库进行交互,因此网站交互性能优   d)网页程序在服务端解析,当客户端向服务器请求数据时,             服务器会直接从磁盘文件系统上返回数据(会做数据解析后返回)

HTTP protocol Learning essay-1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.