Http get request packet size in bytes

前端 未结 4 1827
悲哀的现实
悲哀的现实 2021-02-07 13:07

How many bytes of data does a typical HTTP get request consume. For instance if I request a page from the server through a browser how many bytes of data would be sent?

相关标签:
4条回答
  • 2021-02-07 13:39

    Pretty typical request, 430 bytes:

    GET /ga.js HTTP/1.1\r\n
    Host: www.google-analytics.com\r\n
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)\r\n
    Accept: */*\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Keep-Alive: 300\r\n
    Connection: keep-alive\r\n
    Referer: http://stackoverflow.com/\r\n
    If-Modified-Since: Mon, 31 Aug 2009 17:13:58 GMT\r\n
    \r\n
    \r\n
    

    Request with a long query string and a small cookie 657 bytes)

    GET /pixel;r=978178957;fpan=0;fpa=1241112640-44259546-69321280;ns=0;url=http%3A%2F%2Fstackoverflow.com%2F;ref=;ce=1;je=1;sr=1920x1200x32;dg=E5912-W-MO-5;dst=1;et=1252061014745;tzo=-120;a=p-c1rF4kxgLUzNc HTTP/1.1\r\n
    Host: pixel.quantserve.com\r\n
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)\r\n
    Accept: image/png,image/*;q=0.8,*/*;q=0.5\r\n
    Accept-Language: en-us,en;q=0.5\r\n
    Accept-Encoding: gzip,deflate\r\n
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
    Keep-Alive: 300\r\n
    Connection: keep-alive\r\n
    Referer: http://stackoverflow.com/\r\n
    Cookie: uid=1274108650-45267447-66848880; mc=1137458542-57565784-88898864\r\n
    \r\n
    \r\n
    
    0 讨论(0)
  • 2021-02-07 13:49

    Use Fiddler to intercept the request and see for yourself.

    0 讨论(0)
  • 2021-02-07 13:57

    It varies, especially when it comes to GET queries or POST requests, but I'd estimate it about 0.5—1k.

    Requesting a page from the browser, though, may also result in requesting pictures, stylesheets and other referenced content.

    Edit: originally I put in the estimation for request+reply.

    0 讨论(0)
  • 2021-02-07 14:01

    I would suggest you use a full packet sniffer like wireshark. You would love it :)

    Get it here: http://www.wireshark.org/

    0 讨论(0)
提交回复
热议问题