HTTP protocol details (top)

Source: Internet
Author: User

Write in front: thank Mianserin Web, thanks to task sharing


The HTTP protocol is an agreement that penetration testers or developers must understand, and the HTTP protocol must be used to access the site.

1.http Introduction

HTTP (Hyper Text Transfer protool Hypertext Transfer Protocol), a detailed regulation of the browser and the World Wide Web server to communicate with each other rules, is the World Wide Web exchange information base, Allows HTML (Hypertext Markup Language) documents to be routed from a Web server to a Web browser.

That means we have to use the HTTP protocol to access the site.

2. Observing the HTTP protocol using Firebug and curl

Firebug is a very useful Web debugging tool, you can view the HTTP request;

Curl is a tool that uses URL syntax to transfer files and data, supports many protocols, such as HTTP, FTP, Telnet, and so on, using curl to clearly see the protocol used.

1) Firebug

First open Mozilla Firefox (or Google Chrome) and add the Firebug component

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/78/A4/wKioL1aAxq6TnMuVAACjASgAt8M634.png "title=" Firebug1.png "alt=" Wkiol1aaxq6tnmuvaacjasgat8m634.png "/>

Then visit the website, take http://www.moonsos.com/as an example, right click on the mouse and select "Use Firebug review element"

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/78/A4/wKioL1aAxufjNqqSAACncAll9vI639.png "title=" Firebug2.png "alt=" Wkiol1aaxufjnqqsaacncall9vi639.png "/>

The following interface appears:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/78/A4/wKioL1aAxwXQxxs9AAGdlMGWUGA543.png "title=" Firebug3.png "alt=" Wkiol1aaxwxqxxs9aagdlmgwuga543.png "/>

Then select "Network" and you will see the request information

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/78/A4/wKioL1aAyOfjYI1zAAIlPQ9TwcY925.png "title=" Firebug4.png "alt=" Wkiol1aayofjyi1zaailpq9twcy925.png "/>

Note: Directly right-click on the page, select "Review element" and select "Network" to see the details of the request.


The first time you open Firebug does not display the request information, when we enter in the URL box, we see three get requests indicating that the browser sent three requests to the server

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/78/A4/wKioL1aAysrxiu8OAAHRJu7u4Qc103.png "title=" Firebug6.png "alt=" Wkiol1aaysrxiu8oaahrju7u4qc103.png "/>

Click on any request to see the details of the request in the response header message


3.http Explanation of the request

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/78/AA/wKiom1aA6rzhA4QyAAHKRJvLJkc994.png "title=" Message header 1.png "alt=" Wkiom1aa6rzha4qyaahkrjvljkc994.png "/>

HTTPHeaderCommon Header

header

date

general

provides a date and time flag that explains when the message was created

content-length

entity

gzip The client uses it to determine message truncation .

accept

request

What media types can the client Notification server receive

content-type

entity

media type of object in message

cache-control

general

see   "cache Header"

connection

general

Connection: close http/1.1: close

server

response

identify server software

Set-cookie

Response

sets the server-generated Id

Other Headers

header

expect:100-continue

request

The client informs the server that they require some kind of behavior. our cache software does not support this header

transfer-encoding:chunk

general

using chunked transport

user-agent

request

user's browser software

host

request

the server on which the resource is requested. ( apache host

location

response

redirect client to URL

Vary

Response

The server notifies the client which header from the client is used in the server-side negotiation. Its value is a header list, and the server looks at the headers to determine what content is sent back to the client as a response.


4. Manually simulating HTTP requests


This article is from the "Lanzhi" blog, make sure to keep this source http://7826443.blog.51cto.com/7816443/1729227

HTTP protocol details (top)

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.