Network Transport Protocol

Source: Internet
Author: User
Tags ftp file file transfer protocol ftp file transfer ftp file transfer protocol

Network Transport Protocol 1, common protocols

1, HTTP, HTTPS Hypertext Transfer Protocol

2. FTP File Transfer Protocol

3. SMTP Simple Mail Transfer Protocol

2. HTTP protocol

Hypertext Transfer Protocol (Http,hypertext Transfer Protocol) Web site is based on the HTTP protocol, such as the site's pictures, CSS, JS, etc. are based on the HTTP protocol for transmission.

HTML Hypertext Markup Language

The HTTP protocol is constrained and regulated by requests from the client to the server (request) and responses from the server to the client (Response).

That is, the HTTP protocol is primarily composed of requests and responses.

Common Request Methods POST,GET, PUT, DELETE

We debug via browser plugin FireFox Httpfox. CTRL SHIFT F2 Call

2.1. Request and Request messages

The request is initiated by the client, and its canonical format is: Request line, request header, request principal.

    • 1. Request Line

Consists of the request method, the request URL, and the protocol version

GET /day01/code/login.php?username=123&password=123 HTTP/1.1POST /day01/code/login.php HTTP/1.1
    • 2. Request Header

Host:localhost the requested host

Cache-control:max-age=0 Control Cache

Accept:/ accepted document MIME type

User-agent: It's important.

Referer: from which URL to jump over

Accept-encoding: Acceptable compression format

If-none-match: Records the ETag value of the server response to control the cache

This value is automatically generated by the server

If-modified-since: Record the last-modified value of the server response

This value is automatically generated by the server

    • 3. Request Body

Data that is passed to the server

Note: When a form is submitted as a post, the request header is set

content-type:application/x-www-form-urlencoded, in get form when not needed

2.2. Response and response messages

The response is issued by the server in the canonical format: status line, response header, response body.

    • 1, status line

Consists of the protocol version number, status code, and status information http/1.1 OK

    • 2. Response Head

Date: Response time

Server: Servers information

Last-modified: Resource Last modified time is automatically generated by the server

ETag: Unique identity generated after resource modification

Automatically generated by the server

Content-length: Response Body length

Content-type: Type of response resource

    • 3. Response body

The content that the service side returns to the client;

    • Status code

Common 200 for success, 304 document unmodified, 403 no permissions, 404 Not Found, 500 server error

Network Transport Protocol

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.