search
Homephp教程PHP开发Network transfer protocol (http protocol)

Overview: Refers to the constraints and specifications for communication between the server and the client. The data interaction between the client and the server is not messy and needs to follow (based on) certain specifications.

Common protocols:

a) HTTP、HTTPS 超文本传输协议
 
b) FTP 文件传输协议
 
c) SMTP 简单邮件传输协议

This article mainly introduces the http hypertext transfer protocol.

1. HTTP protocol

is the Hypertext Transfer Protocol. The website is based on the HTTP protocol. For example, the images, CSS, JS, etc. of the website are all transmitted based on the HTTP protocol. The HTTP protocol is constrained and standardized by the request (Request) from the client to the server and the response (Response) from the server to the client. Commonly used request methods are: GET, POST, PUT, DELETE. 2. Request -Request message:

a) The request is initiated by the client, and its standard format is: request line, request header, and request body. For example:

b) Request message line: composed of request method, request URL and protocol version

c) Request message header

Host:localhost请求的主机
Cache-Control:max-age=0控制缓存(no-cache| no-store)
Accept:*/* 接受的文档MIME类型
User-Agent:向访问网站提供你所使用的浏览器类型、操作系统及版本、CPU 类型、浏览器渲染引擎、浏览器语言、浏览器插件等信息的标识. 浏览器UA 字串的标准格式为: 浏览器标识 (操作系统标识; 加密等级标识; 浏览器语言) 渲染引擎标识 版本信息
Referer:从哪个URL跳转过来的
Accept-Encoding:可接受的压缩格式
Network transfer protocol (http protocol)

d) Request message body: that is passed to the server Data

Note: When submitting the form in the form of post, Content-Type: application/x-www-form-urlencoded will be set in the request header, but this setting is not required when requesting in the form of get

3. Response -Response message:

a) The response is sent by the server, and its standard format is: status line, response header, response body

b) Response header:

Date:响应时间
Server:服务器信息
Content-Length:响应主体长度
Content-Type:响应资源的MIME类型
Network transfer protocol (http protocol)

c) Response body: that is Content returned by the server to the client

d) Status code:

Common status codes are: 200---The server successfully returned the web page, 304---The document has not been modified, 403---No permission, 404 ---The requested web page does not exist, 500---server error, 503---service unavailable

Explanation: The client and server transmit data in byte form, which can be understood as text Form transmission, then the browser needs to know clearly how to parse these text-form data. MIME clearly tells the browser how to process itNetwork transfer protocol (http protocol)

There are many knowledge points about the http protocol. This article only introduces its transmission. Approximate process. Learning and understanding its components is to better understand ajax.


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools