14

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 Answers 4

37

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 
Sign up to request clarification or add additional context in comments.

3 Comments

How did you get to that figure?
I sniffed it with tcpdump and counted the bytes in the headers with some standard unix tools.
Thanks! for elaborate header packet dump.
5

Use Fiddler to intercept the request and see for yourself.

5 Comments

wouldn't it be easier not to answer at all instead disguising the fsck off as an answer? ;-)
@hacker: I meant it as a serious answer. The request size can vary so nobody can provide a definite answer to the question. I mentioned a method and actually provided a link to Fiddler. How this answer is fsck off?
Well, you suggested to see for yourself. Although that is definitely superior technique that both you and me would employ, this is not even an attempt on estimation (of course you can't provide a definite answer!). I do not really see your answer as wrong or bad, I just don't see it as an answer ;-) I was tempted to do it myself, but I would put it as comment then. And yes, you can disagree with me on that, that's fine ;-)
hacker: If I'd written "Intercept the request and see for yourself," I would post it as a comment. However, I believe an answer is something that solves the OP's problem, directly or indirectly. This is a method for solving the actual problem OP has, and therefore, is a valid answer IMO.
Mahrdad, well, that makes sense.
4

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.

Comments

3

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

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.