get请求报文

GET /02_WEB_HTTP/index.html?username=admin&password=123123 HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
Referer: http://localhost:8080/02_WEB_HTTP/form.html
Accept-Language: zh-CN,en-US;q=0.7,ko-KR;q=0.3
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)
Accept-Encoding: gzip, deflate
Host: localhost:8080
Connection: Keep-Alive
 
get请求报文的格式:
    请求首行
        GET /02_WEB_HTTP/index.html?username=admin&password=123123 HTTP/1.1
        请求方式 资源路径?查询字符串 协议名/版本
 
    请求头
        > 经过观察发现请求头实际就是一组一组的键值对结构,有的是一个键对应一个值,有的是一个键对应多个值
        Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
        浏览器可以接收的数据的格式:这里面设置的都是MIME值,*/*代表任意文件
 
        Referer: http://localhost:8080/02_WEB_HTTP/form.html
        请求的来源:
            作用:
                1.广告计费
                2.网站的防盗链
 
        Accept-Language: zh-CN,en-US;q=0.7,ko-KR;q=0.3
        运行的语言:zh-CN代表中文,主要用来做国际化
 
        User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)
        用户的系统信息:
 
        Accept-Encoding: gzip, deflate
        支持的压缩编码:
 
        Host: localhost:8080
        主机地址:
 
        Connection: Keep-Alive
        连接时间:Keep-Alive表示是一个长连接,时间大概是2分钟
 
 
GET请求没有请求体
除了表单的method属性设置为post时,其余的全都是get请求。
 
 

转载请注明出处!

http://www.cnblogs.com/libingbin/

感谢您的阅读。如果文章对您有用,那么请轻轻点个赞,以资鼓励。

原文地址:https://www.cnblogs.com/libingbin/p/5949669.html