search
HomeCommon ProblemHow to write the URL format http

How to write the URL format http

Jul 30, 2019 am 11:55 AM
http

How to write the URL format http

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:

http://www.php.cn: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 www.php.cn. 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!

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool