The correct URL example of http service is http://www.cnic.ac.cn.
HTTP: (Hypertext transfer protocol) Hypertext Transfer Protocol, which is used to transfer hypertext from the World Wide Web (WWW: World Wide Web) server to the local browser transport protocol. (Recommended learning: phpstorm)
URL: (Uniform Resource Locator) Uniform Resource Locator, the location and access method of resources that can be obtained from the Internet A concise representation of the address of a standard resource on the Internet.
2 HTTP Features
1. Simple and fast: When a client requests a service from the server, it only needs to transmit the request method and path. Commonly used request methods are GET, HEAD, and POST. Each method specifies a different type of contact between the client and the server. Due to the simplicity of the HTTP protocol, the program size of the HTTP server is small and the communication speed is very fast.
2. Flexible: HTTP allows the transmission of any type of data object.
3. No connection: The meaning of no connection is to limit each connection to only process one request. After the server processes the client's request and receives the client's response, it disconnects. This method saves transmission time.
4. Stateless: HTTP protocol is a stateless protocol. Stateless means that the protocol has no memory ability for transaction processing.
5. Support B/S and C/S modes.
Three URL composition
HTTP uses Uniform Resource Identifiers (URIs) to transmit data and establish connections. A URL is a special type of URI that contains enough information to find a resource.
Take the following URL as an example:
http://www.aspxfans.com:8080/news/index.asp?boardID=5&ID=24618&page=1#name
1. Protocol part: It means that the web page uses the HTTP protocol. Various protocols can be used in the Internet, such as HTTP, FTP, etc. The "//" after "HTTP" is the delimiter
2. Domain name part: "www.aspxfans.com". In a URL, you can also use the IP address as the domain name using
3. Port part: Following the domain name is the port, and ":" is used as the separator between the domain name and the port. The port is not a necessary part of a URL. If the port part is omitted, the default port 80/tcp
4 will be used. 4. Virtual directory part: starting from the first "/" after the domain name to the last "/" , is the virtual directory part. The virtual directory is also not a required part of a URL. The virtual directory in this example is "/news/"
5. File name part: Starting from the last "/" after the domain name and ending with "?", it is the file name part. If there is no "?" , it starts from the last "/" after the domain name and ends with "#", which is the file part. If there are no "?" and "#", then it starts from the last "/" after the domain name and ends with it. name part. The file name in this example is "index.asp". The file name part is not a necessary part of a URL. If this part is omitted, the default file name
will be used. 6. Anchor part: From the beginning to the end of "#", it is the anchor part. The anchor part in this case is "name". The anchor part is not a necessary part of a URL (can be understood as positioning)
7. Parameter part: The part from "?" to "#" is the parameter part, also known as the search part and query part. The parameter part in this example is "boardID=5&ID=24618&page=1". Parameters can allow multiple parameters, and "&" is used as a separator between parameters.
The above is the detailed content of Correct example of url for http service. For more information, please follow other related articles on the PHP Chinese website!