HTTP information is divided into three parts
1. Request Line
GET lizi.php http/1.1
2.HTTP Head Letter
Host:localhost connection:keep-alive
Cache-control:max-age=0
accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
user-agent:mozilla/5.0 (Windows NT 6.1) applewebkit/537.36 (khtml, like Gecko) chrome/41.0.2272.101 safari/537.36
Referer:http://localhost/lizi.html
Accept-encoding:gzip, deflate, SDCH
accept-language:zh-cn,zh;q=0.8,en;q=0.6
Cookie:name=kang
ra-ver:2.10.3
Ra-sid:dcb4efbd-20140418-043349-b3d8d4-8da4c7
3. Content
。。。。。。。
Note: There is no content when GET request mode, because he put the content in the URL, post is there, so can also say get not conform to the specification
The emphasis is on HTTP header information.
Head can be said to be a hodgepodge warehouse, for the client and the server to interact with the information, that is, the field in the header information can be customized, add any kind of no impact
In the client browser, the cookie is sent to the client in the header, which is placed by the browser, and we can simulate placing other information
Example:
1 $head=Array(2"Host:localhost",3"Connection:keep-alive",4"accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.85user-agent:mozilla/5.0 (Windows NT 6.1) applewebkit/537.36 (khtml, like Gecko) chrome/41.0.2272.101 S Afari/537.36 ",6"Referer:http://localhost/lizi.html",7"Accept-encoding:gzip, deflate, sdch",8"accept-language:zh-cn,zh;q=0.8,en;q=0.6",9"Cookie:name3=kang",Ten"Demo:demo", One"ra-ver:2.10.3", A"Ra-sid:dcb4efbd-20140418-043349-b3d8d4-8da4c7", -);
This head can be sent with curl
Randomly inserted in the middle of the cookie and the demo field, print $_server on the server can be fully accepted
=
String
' localhost ' (length=9) =
String
' keep-alive ' (length=10) =
String
' text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8user-agent:mozilla/5.0 (Windows NT 6.1) applewebkit/537.36 (khtml, like Gecko) chrome/41.0.2272.101 safari/537.36 '(length=194) =
String
' http://localhost/lizi.html ' (length=26) =
String
' gzip, deflate, SDCH ' (length=19) =
String
' zh-cn,zh;q=0.8,en;q=0.6 ' (length=23) =
String
' Name3=kang ' (length=10) =
String
' demo ' (length=4) =
String
' 2.10.3 ' (length=6) =
String
' Dcb4efbd-20140418-043349-b3d8d4-8da4c7 ' (length=38)
Change HTTP header information