HTTP protocol Basics

Source: Internet
Author: User

Concept:

The HTTP protocol is an abbreviation for the Hyper text Transfer Protocol (hypertext transfer protocol), which is used to transfer hypertext to the local browser from the World Wide Web (www:world Wide Web) server. Based on TCP/IP communication protocol to transmit data (HTML files, image files, query results, etc.);

HTTP is an object-oriented protocol belonging to the application layer, which is suitable for distributed hypermedia information System because of its simple and fast way. Work on Client-server architecture, support B/S and c/s mode

Main Features:

1, Simple and fast: when a customer requests a service from the server, it simply transmits the request method and Path. The request method commonly has, POST. Each method specifies a different type of contact between the customer and the Server. Because the HTTP protocol is simple, the HTTP server's program size is small, so the communication speed is Fast.

2, flexible: HTTP allows the transfer of any type of data objects. The type being transmitted is marked by Content-type.

3. No connection: the meaning of no connection is to limit the processing of only one request per Connection. When the server finishes processing the Customer's request and receives the Customer's answer, the connection is Disconnected. In this way, the transmission time can be saved.

4. Stateless: The HTTP protocol is a stateless Protocol. Stateless means that the protocol has no memory capacity for transactional processing. A lack of state means that if the previous information is required for subsequent processing, it must be re-routed, which may cause the amount of data to be transferred per connection to Increase. On the other hand, it responds faster when the server does not need the previous Information.

HTTP Url:

URL full name is uniformresourcelocator, Chinese is called "uniform resource locator", used to identify the address of a resource

Example:

Http://www.aspxfans.com:8080/news/index.asp?boardID=5&ID=24618&page=1#name

1. Part of the Agreement: the Protocol section is "http:" and the HTTP protocol is used on behalf of the Web Page. You can use multiple protocols in the internet, such as http,ftp, and so on, in this case the HTTP Protocol. "//" after "HTTP" is a delimiter

2. Domain name part: the domain name portion of the URL is "www.aspxfans.com". A url, you can also use the IP address as a domain name;

3. Port section: followed by the domain name is the port, between the domain name and the port using ":" as the Delimiter. The port is not a required part of the URL and if the port portion is omitted, the default port will be used

4. Virtual Directory part: 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 the URL. The virtual directory in this example is "/news/"

5. File name part: from the last "/" after the domain name to "?" "so far, is the file name part, if there is no"? ", then from the domain name after the Last"/"start to" # "so far, is the document part, if not"? "and" # ", then from the Last"/"after the domain name to the end, is the file name Section. The file name in this example is "index.asp". The file name section is also not a required part of the url, and if omitted, the default file name is used

6. Anchor Part: from the beginning of "#" to the end, are the anchor Parts. The anchor section in this example is "name". The anchor part is also not a required part of the URL

7. Parameters Section: from "? The part between start and # is the parameter part, also called the search section, the query part. The parameters section in this example is "boardid=5 & id=24618 & page=1". Parameters can be allowed to have more than one parameter, with "&" as the delimiter between parameters and Parameters.

--------------------------------------------------------------------------------------------------------------- ----------------------------

The difference between a URI and a URL and a urn

URI: a Uniform Resource identifier used to uniquely identify a resource.

Every resource available on the web, such as HTML documents, images, video clips, programs, etc., is a URI to Locate.
URIs are generally made up of three parts:
① naming mechanism for accessing resources
② host name of the storage resource
The name of the ③ resource itself, represented by a path, with emphasis on Resources.

Url: the Uniform Resource Locator is a specific URI that the URL can use to identify a resource and also how to locate (locate) the Resource.

URLs are strings used on the Internet to describe information resources, mainly used in various WWW client programs and server programs, especially the famous Mosaic.
URLs can be used in a unified format to describe various information resources, including files, server addresses and Directories. The URL is generally composed of three parts:
① Protocol (or Service Mode)
② host IP address (sometimes including port Number) for this resource
③ the specific address of the host Resource. such as directory and file name, etc.

URN: Uniform Resource Name

URIs define a Uniform resource identity in an abstract, high-level concept, whereas URLs and urns are the exact way the resource is Identified. URLs and urns are all a kind of uri.

HTTP protocol Basics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.