HTTP methods, status codes and components
Http(Hypertext Transfer Protocol)
HTTP protocol (HyperText Transfer Protocol, Hypertext Transfer Protocol) is used to transfer files from the WWW A transfer protocol used by servers to transmit hypertext to local browsers. It can make the browser more efficient and reduce network transmission. It not only ensures that the computer transmits hypertext documents correctly and quickly, but also determines which part of the document is transmitted and which part of the content is displayed first (such as text before graphics), etc.
The information used for http protocol interaction is called a http message. The http message from the requesting end (client) is called a request message, and the
httpmessage from the responding end (server) is called a response message. The request message consists of request method
, requestURI, protocol version, header field (optional), content entity (optional) The response message consists of protocol version, status code
, reason phrase, header field (optional), and entity bodyIn each message, the request URI, protocol version, status code, reason phrase, header field belongs to the message header, then a blank line, and the rest is the message body.
There are 4 types of header fields: request header field, response header field, general header field, entity header field, general header and entity header are the request message and Both response messages have them, while request headers are only available in request messages, and response headers are only available in response messages.
Message is the basic unit in http communication, consisting of 8 bits Composed of byte stream, transmitted through http communication.
The entity is transmitted as the payload data (supplementary item) of the request and response, and its content consists of the entity header and the entity bodyGenerally, the message body is equal to the entity body . Only when the encoding operation is performed during transmission and the content of the entity body changes, will it be inconsistent with the message body.http1.0 and http1.1Supported methods
Method |
Description |
Support httpProtocol version |
##GET | Get the resource identified by URI |
1.0,1.1 |
##POST |
##Transmission Entity Body
|
1.0,1.1
|
| Transfer files( Without verification mechanism) | 1.0,1.1|
Get the message header |
1.0,1.1 |
|
file | (without verification Mechanism)##1.0,1.1 |
|
OPTIONS |
##Ask for support methods |
1.1 |
TRACE |
Trace path |
##1.1
|
##1.1 |
|
|
Establish connections with resources |
1.0 |
|
Disconnect link relationship |
##1.0 |
##http
Status code##Status code
Category |
Reason Phrase |
1XX |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Informational (Informational status code) | ##2XX |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Success (success status code) |
The request has been processed normally. |
##3XX |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(Redirect status code) |
4XX
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The server cannot process the request
| ##5XX|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commonly used status codes in
14
|
The above is the detailed content of HTTP methods, status codes and components. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Introduction to HTTP 525 status code: Understand its definition and usage HTTP (HypertextTransferProtocol) 525 status code means that an error occurred on the server during the SSL handshake, resulting in the inability to establish a secure connection. The server returns this status code when an error occurs during the Transport Layer Security (TLS) handshake. This status code falls into the server error category and usually indicates a server configuration or setup problem. When the client tries to connect to the server via HTTPS, the server has no

Understand the meaning of HTTP 301 status code: common application scenarios of web page redirection. With the rapid development of the Internet, people's requirements for web page interaction are becoming higher and higher. In the field of web design, web page redirection is a common and important technology, implemented through the HTTP 301 status code. This article will explore the meaning of HTTP 301 status code and common application scenarios in web page redirection. HTTP301 status code refers to permanent redirect (PermanentRedirect). When the server receives the client's

HTTP Status Code 200: Explore the Meaning and Purpose of Successful Responses HTTP status codes are numeric codes used to indicate the status of a server's response. Among them, status code 200 indicates that the request has been successfully processed by the server. This article will explore the specific meaning and use of HTTP status code 200. First, let us understand the classification of HTTP status codes. Status codes are divided into five categories, namely 1xx, 2xx, 3xx, 4xx and 5xx. Among them, 2xx indicates a successful response. And 200 is the most common status code in 2xx

Interpreting HTTP Status Code 301: How to Correctly Handle Permanent Redirect Errors HTTP status codes are a very important part of web applications. They provide information to the client about the processing status of the request. The 301 status code is a special status code that indicates that the requested resource has been permanently moved to a new location. In this article, we will interpret the 301 status code and discuss how to properly handle permanent redirect errors. 1. Understand the 301 status code. When the server receives a request from the client, if the requested resource has been

The HTTP request times out, and the server often returns the 504GatewayTimeout status code. This status code indicates that when the server executes a request, it still fails to obtain the resources required for the request or complete the processing of the request after a period of time. It is a status code of the 5xx series, which indicates that the server has encountered a temporary problem or overload, resulting in the inability to correctly handle the client's request. In the HTTP protocol, various status codes have specific meanings and uses, and the 504 status code is used to indicate request timeout issues. in customer

An in-depth interpretation of HTTP protocol status codes: Why status codes are crucial to website development. With the rapid development of the Internet, website development has become more and more important. In website development, the HTTP protocol plays a vital role. It defines the communication specifications between browsers and servers to transfer data through requests and responses. The HTTP status code is part of this process and is used to indicate the processing of the request. This article will provide an in-depth explanation of the role and significance of HTTP protocol status codes. HTTP status code is a three-digit number

Methods to obtain http status codes use browsers and use programming languages, etc. Detailed introduction: 1. Using a browser, when accessing a web page in the browser, the browser will send an HTTP request to the server, and display the content of the web page after receiving the response from the server. The browser usually displays the content in the developer tools of the page. Display the HTTP status code in; 2. Use a programming language. If you want to obtain the HTTP status code through programming, you can use libraries and functions provided by various programming languages.

Sending requests using axios is a very common operation in Vue applications. However, when making ajax requests, sometimes you encounter some problems, such as a 403 error. Below we will discuss the problem of "Uncaught(inpromise)Error: Requestfailedwithstatuscode403" when using axios in a Vue application and its solution. First, let us explain error code 403, it
