
If you want to know more interesting knowledge about computers, you can click: FAQ
This article introduces the specifications of the HTTP protocol in depth. This article mainly introduces its URI, Request, Response, status code and other information. By understanding these specific contents, you can more intuitively understand the HTTP protocol format and working principle. .
URI structure
HTTP uses Uniform Resource Identifiers (URIs) to transmit data and establish connections. URL (Uniform Resource Locator) is a special type of URI that contains enough information for finding resources. We generally use URLs, and a complete URL contains the following parts:
//m.sbmmt.com:80/mix/76.html?name=kelvin&password=123456#first
1. Agreement part
The protocol part of the URL is http:, which means that the web page uses the HTTP protocol, and the following // is the delimiter
2. Domain name part
Domain name It is m.sbmmt.com. When sending a request, you need to resolve the IP to the DNS server. If you want to optimize the request, you can directly use IP as the domain name part
3. Port part
The 80 after the domain name represents the port, and is separated from the domain name by:. The port is not a required part of a URL. If the port is 80, you can also omit it and write
4. The virtual directory part
Starting from the first / of the domain name to the last / is the virtual directory part. Among them, the virtual directory is not a necessary part of the URL. The virtual directory in this example is /mix/
5. The file name part
From the last / of the domain name to ?, it is the file name part; if there is no ?, it starts from the last / of the domain name and ends with #, it is the file name part; if there is no ? and #, then it starts from the last / of the domain name From the beginning to the end, it is the file name part. The file name in this example is 76.html, and the file name is not a required part of a URL. If there is no file name, the default file name is used
6. Anchor part
From the beginning to the end of #, it is the anchor part. The anchor part of this part is first, and the anchor is not a necessary part of a URL
7. Parameter part
Starting from ? to ## The part between ## is the parameter part, also called the search part and the query part. The parameter in this example is name=kelvin&password=123456. If there are multiple parameters, use & as the separator between each parameter.
The above is the detailed content of How to write the URL format http. 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

SublimeText3 Chinese version
Chinese version, very easy to use

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools

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),

Zend Studio 13.0.1
Powerful PHP integrated development environment





