HTTP Learning Note One

Source: Internet
Author: User

What the browser sees is called Hypertext transfer.

HTTPS is based on Secure Sockets Layer HTTP, which is more secure

HTTP Protocol Concepts and workflow

Importance: Later with WebService, or with rest to do large architectures, are inseparable from the HTTP protocol

Simplified saying: WebService = HTTP protocol + XML

Rest = HTTP protocol + JSON

Various APIs are generally implemented by HTTP, XML, and JSON.

For example, you need to know the HTTP protocol.

As well as Ajax, after learning about HTTP, Ajax is very easy to understand

What is an agreement :

Agreement is two people to reach a consensus, the norm (consensus) can be called the agreement, a double-copy.

Computers can communicate all over the world because they follow this protocol.

The HTTP protocol is to request or send data to the server according to certain rules, and the server responds to the data according to certain rules.

What is connection, the connection is the virtual circuit on the network

Request header for Header

Response Header Response Head

Format of HTTP request information and response information

Request:

1, Request line (Request method, path, protocol)

2, request header information (in the format: key:value)

3, empty line

4, request principal information (can not)

There is a line between the header information and the principal information, even if no body is requested

The request line is divided into 3 parts.

protocol used to request a method request path

Request method: GET POST PUT DELETE TRACE OPTIONS

Protocol used: http/1.1

Q: Can the browser send the HTTP protocol, must the HTTP protocol be sent by the browser?

Answer: No.

1, GET is the request Way (method)

2,/a.php request resource

3, the protocol version used by the http/1.1 request

Note: After the header information has ended, there is a blank line

Header information and subject information, need a blank line to make a distinction

Empty lines are not available even without the principal information

Post request, post is more than GET request information

To tell the server content-type:application/x-www-form-urlencoded

Content-length:xxx

Then newline, enter the request body

Status code, status text:

The status code is used to reflect the response of the server.

The most common ok,404 not FOUND

200 server successfully returned to Web page

301/2 Permanent/Temporary redirection

304 Not Modified unmodified

Maintaining the original request data in 307 redirects

Failed status code:

404 The requested page does not exist

503 Server is temporarily unavailable

500 Server Internal Error

From the study of HTTP, understand that there is no big website optimization, so-called optimization is to find the cause of the slow site, broadband issues, or front-end display, or database problems, and then go to the corresponding changes. Website optimization is a comprehensive technology.

HTTP Learning Note One

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.