HTTP Transfer Protocol

Source: Internet
Author: User

HTTP Transfer Protocol-learning notes

    1. HTTP data transfer format

The basic format is:

    • Request or answer Line
    • Request or Answer Header
    • Blank Line
    • Data
    1. Post transfer format
    2. Underlying data communication:

Client Request:

post/response.php http/1.1???? ---request line

Accept:application/x-ms-application, Image/jpeg, Application/xaml+xml, Image/gif, Image/pjpeg, application/ X-MS-XBAP, */*

referer:http://local/

..................

Connection:keep-alive

Pragma:no-cache

?

w=12&h=23&s=276

Server Answer:

http/1.1 OK???? ---request line

Date:thu, 15:08:17 GMT???? ---request header

............

Content-type:text/html

?

??????????? 276???? ---response information

?

    1. PHP Implementation method:

Form page PHP:

<form action= "response.php" method= "POST" >

<input type= "Text" Name= "W" ><br>

<input type= "text" name= "H" ><br>

..................

<input type= "text" name= "S" >

<input type= "Submit" >

</form>

Answer page PHP:

Can use $_post["s"]; method to get the value of the uploaded variable, preferably using a script for validation

    1. Summarize:

The Post method places the data in the data section

    1. Get transfer format
    2. Underlying data communication

Client Request:

get/response.php?w=12&h=122&s=1464 http/1.1

Accept:application/x-ms-application, Image/jpeg, Application/xaml+xml, Image/gif, Image/pjpeg, application/ X-MS-XBAP, */*

..................

Connection:keep-alive

Server Answer:

http/1.1 OK

Date:thu, Jan 15:39:56 GMT

............

Content-type:text/html

?

??????????? 1464

    1. PHP Implementation method:

Form page PHP:

<form action= "response.php" method= "Get" >

<input type= "Text" Name= "W" ><br>

<input type= "text" name= "H" ><br>

..................

<input type= "text" name= "S" >

<input type= "Submit" >

</form>

Answer page PHP:

Can use $_get["s"]; method to get the value of the uploaded variable, preferably using a script for validation

    1. Summarize:

The Get method puts the data in the header in terms of the data transfer

    1. Error response Format

Take value

Describe

1xx

Keep.

2xx

Successful reception, such as "200", indicates successful processing.

3xx

The customer needs to refine the request further.

4xx

A client error, such as "404", means that the specified resource for access does not exist.

5xx

Server error.

?

?

?

?

?

?

?

?

users can set the wrong answer page in the. htaccess file

    1. Summarize

This article introduces the basic format of HTTP communication, detailed protocol format definition can refer to HTTP1.1 (RFC2616 document), as for port monitoring can use Fiddler2 software for the bottom view, the software is cracked green version, can be easily done.

Fiddler can monitor the local server port for easy debugging and can modify the 127.0.0.1 in the Hosts file as:

Local 127.0.01

In the browser directly in the address bar to enter local, if you need to only monitor the local address in the Fiddler, then set the use of filters in the filter, and in the only display of the following host in the edit box to display only local data communications information, In addition, you can see the underlying detailed communication data in the raw bar, which is plain text and convenient for analysis.

?

?

?

^_^ Bruce Lone

2015-1-30

HTTP Transfer 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.