current position：Home>Explanation of HTTP network protocol
Explanation of HTTP network protocol
2022-06-24 08:55:13【Software testing Xiaobai】
HTTP Network protocol
What is? HTTP?
HTTP yes Hyper Text Transfer Protocol( Hypertext transfer protocol ) Abbreviation . It's based on TCP/IP Communication protocol to transmit data .
Simply speaking , It is a kind of agreement , An agreement between a client and a server .
What is an agreement ?
The language of communication between computers is called protocol , Different computers must use the same protocol to communicate .
HTTP Network communication process
HTTP The protocol works between the client and the server , The whole communication process , The browser acts as HTTP Client pass URL towards HTTP The server is WEB The server sends all requests ,Web According to the received request , Will send a response message to the client .
URL form ：
1. The partial The URL Part of the agreement is “http：”, This means that the Web uses HTTP agreement . stay Internet A variety of protocols can be used in , Such as HTTP,FTP wait .
2. domain name /ip The URL The domain name section is www.baidu.com, or ：http://18.104.22.168, They are both Baidu websites
3. Port part Following the domain name is the port , Use between domain name and port “:” As a separator . without , It means that URL The default port is used .
4. route From the first after the domain name “/” Let's go to the last one “/” until , It's the path part .
5. Parameters of the part from “？” Start to “#” The part in between is the parameter part , Also known as query parameters . Parameters can be allowed to have more than one parameter , Between parameters “&” As a separator .
The carrier of information transmission between client and server is called message , The message is divided into two parts: request and response .
Request message ：
The process by which a client sends data to a server is called a request message
Request line ： Include request method , The resources to visit and the HTTP edition
Request header ： Describe additional information the server will use
Blank line ： An empty line after the request message header is required
Request body ：get There is often no requester ,post The request body contains the requested parameters
Request method ：
GET： The request for Request-URI Identified resources .
POST： stay Request-URI New data is appended to the identified resource .
HEAD： Request to get by Request-URI The response header of the identified resource .
PUT： Request the server to store a resource , And use Request-URI As its logo .
DELETE： Request server delete Request-URI Identified resources .
TRACE： The request server sends back the received request information , Mainly used for testing or diagnosis .
CONNECT： Keep it for future use .
OPTIONS： Request query server performance , Or Query options and requirements related to resources .
The common request method in practical application is GET and POST.
GET and POST The difference between ：
1. From the perspective of parameter passing ：GET The requested parameters are spliced directly into the address bar URL Behind , and POST The request parameters are placed in the request body .
2. In terms of length limitation ：GET The request has a specific length limit , Generally not more than 1024KB, and POST In theory, there is no , But browsers generally have a boundary .
3. In terms of security ：GET Request compared to POST, Because the data is displayed in clear text URL above , So security and privacy are not as good as POST.
4. In terms of function ,GET Get data from the server ,POST Is to send data to the server .
response message :
1. Response line （ Status line ）： Protocol version , Status code , Success and failure status information .
2. Response head ： It consists of some key value pairs , It is used to describe some additional information to be used by the client .
3. Blank line ： An empty line after the response header is required .
4. The response data （ Response Content ）： The data and other information returned by the server to the client .
Status code and classification
When visitors visit a web page , The browser will send a request to the server where the web page is located . Before the browser receives and displays the web page , The server on which this page is located will return an include HTTP The header of the status code is used to respond to the browser's request .
Common status code categories
https and http What's the difference?
https yes http Security version of , Also known as hypertext secure transmission ,https It is a channel with encrypted transmission protocol , also SSL Provides the basis for secure encryption ,https Mainly for http The transmission of , And in HTTP And TCP There is a special encryption between / Authentication .
port ：https The port of is 443, and http The port of is 80, Of course, the connection mode of the two is also different .
To transmit data ：http The transmission is plaintext , and https Yes, it is ssl Encrypted ,https It's safe .
Apply for a certificate ：https Transmission generally requires application for certificate , There may be a fee for applying for a certificate , and http Unwanted .
author[Software testing Xiaobai],Please bring the original link to reprint, thank you.
The sidebar is recommended
- Springboot+vue project tourism information recommendation system [source code open source]
- Ultra wideband pulse positioning scheme, UWB precise positioning technology, wireless indoor positioning application
- Elementui used tabs to step on the pit
- Ant Design Vue - remove the input component border and the border blue shadow effect when getting focus
- Get httponly protected cookies across sub domains through XSS
- Coding specification - Vue project
- Code specification - HTML
guess what you like
Code writing specification - CSS
CSS Notes 6
Quickly set up PgSQL for serverless
404405 troubleshooting after Vue uses proxy packaging
Vue3 TS learning
What is the charm of python, which is warmly pursued by countless programmers?
CSS (PC side) three methods of traditional page layout
Inline element, block element, inline block element
- 19、 Lua garbage collection of enterprise rapid development platform spring cloud+spring boot+mybatis+elementui
- Detailed introduction to render props and high-level component hoc in react tutorial
- Introduction to high order components (HOC) in react tutorial
- Front end and back end love and hate -- sequel
- When Vue adds on-demand loading to the UI library and starts the project, an error is reported in babel-preset-es2015
- Select in element uses typescript to define initial data, which has no effect
- Vue video player of Vue player plug-in
- React configuration component path reference @ to represent SRC root path
- Use less and CSS modules in react scaffold Engineering
- Plug in download instructions and introduction of Vue in the web front end, NPM, install, save
- Summary of front-end common interview questions
- Vue hook function
- Monitor page rotation in Vue, and display in full screen on echarts mobile terminal
- Webpack learning notes series 07- how it works
- Webpack learning notes series 06- Packaging Optimization
- Webpack learning notes series 08-hmr hot update
- [Vue] understanding and thinking of new features based on Vue 3
- Fasthttp: go framework ten times faster than net/http (server)
- The difference between preload and prefetch and how to optimize in webpack projects
- Several ways of calling methods to transfer parameters in react render
- Axios usage
- LabVIEW finds prime numbers in an array of n elements
- Elementui form custom regular expression validation text box
- Export markdown to HTML, PDF with browser
- Experience summary of typescript transformation process of old vue2.x projects
- Front end development uses graphql -- vue3 uses graphql
- JS to get the last element of the array
- About Axios request - delete method
- The salon for the first anniversary of the open source of oasis, an ant interactive graphics engine, is coming. On February 26, we will see you in the live studio!
- Best practices for cookie notification
- How does HTML5 implement live streaming? It's worth learning!
- Record webpackdemo configuration
- Android studio uses iconfont Ali vector icon library
- HttpMediaTypeNotSupportedException: Content type ‘application. yml/json； charset=UTF-8‘ not supported
- CSS notes
- Nginx enables geoip2 module to realize national city identification - the road to dream
- Database to query the quantity of books lent in this month. If it is higher than 10, it will display "more than 10 books lent in this month". Otherwise, it will display "less than 10 books lent in this month"