[Note JS/HTML/CSS] HTTP protocol (1) in the web, jscss

Source: Internet
Author: User

[Note JS/HTML/CSS] HTTP protocol (1) in the web, jscss

Recently, I have been teaching in coursera, and I am also busy with my own courses. I always forget to write Study Notes ORZ.

Introspection ing...

When writing HTML, the form must submit and query data (for example) to the server over HTTP)

The client sends data to the Server over HTTP

The main methods include GET and POST (Other methods include PUT, DELETE, and HEAD)

There are two types of HTTP message formats: request and response.

The request message can be abstracted:

The HTTP head contains some request information. The first line is request line, which consists of the method fields (such as GET/POST), url fields, and HTTP Protocol version fields.

The following lines are header line.

The HTTP entity body is empty when the GET method is used. The POST method contains some form submission information and files.

Generally, GET is used for data request (if the method is not declared, the default value is GET), and POST is used for data submission.

GET can only transmit a small amount of data, and the transmitted data is displayed in the url, which is not secure.

POST can transmit more data than GET. The POST method is required when uploading files (multiple bytes) and passwords (requiring high security ).

 

Response message can be abstracted:

The status line of the first line in the HTTP head, including the HTTP Version Information and status code.

The next few lines are header line, which indicates information about some server versions and HTTP entity bodies.

E.g. content-type: text/html indicates that the body contains an html file.

 

Some common status codes:

200 OK: enabled successfully

301 Moved Permanently: The request object is Permanently removed.

400 Bad Request: Incorrect Request that cannot be understood by the server

401 Not Found: the requested object is Not on the server.

505 HTTP Version Not Supported: the server does Not pay for the HTTP Version of the current Request message

 

 

For study notes only. If you have any errors, please point out> <, THX...

 

Related Article

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.