...

View Full Version : Question about HTTP Headers



missing-score
11-12-2005, 01:01 AM
Hey there, I have a question about HTTP response headers... Here is an example response header from PHP.net:


HTTP/1.1 200 OK
Date: Fri, 11 Nov 2005 23:35:55 GMT
Server: Apache/1.3.26 (Unix) mod_gzip/1.3.26.1a PHP/4.3.3-dev
X-Powered-By: PHP/4.3.3-dev
Last-Modified: Fri, 11 Nov 2005 23:25:48 GMT
Content-language: en
Set-Cookie: COUNTRY=GBR%2C86.133.245.211; expires=Fri, 18-Nov-05 23:35:55 GMT; path=/; domain=.php.net
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html;charset=ISO-8859-1

2175

I'm just wondering what the bit in red is, before the HTML document starts, anyone have any ideas?

mlseim
11-12-2005, 02:03 AM
It's short for "Two-Thousand One-Hundred and Seventy Five" ...

... just kidding ...

I don't know.

It looks like something the server or whatever outputted along with the text.
You would almost have to look into the server source code that generated it.

maybe a byte count?

missing-score
11-12-2005, 04:30 AM
No, it can't be... If it had a byte count it would be set in "Content-Length: 1234", besides the page was easily more, and on one of my own pages I got something like "18b".

anshul
11-12-2005, 11:21 AM
This example:
http://curl.haxx.se/libcurl/php/examples/callbacks.html

outputs headers in a different way.

What's the red thing? :confused: ya!

schleppel
11-12-2005, 04:11 PM
It might be because of HTTP/1.1, the bottom post (http://uk2.php.net/manual/en/function.fsockopen.php#18037) on fsockopen (http://uk2.php.net/fsockopen) on php.net says


This is a "gotcha" that "got me" and discusses the careful use of HTTP/1.1 over HTTP/1.0

I had a script that suffered dreadful performance and return Hex values amongst the correct data. This was eventually traced to my inclusion of HTTP/1.1

[cut]

By sending a HTTP/1.1 request it declares that it is willing to 'speak' HTTP/1.1, of course, but there are some aspects of HTTP/1.1 that make it necessary to handle the socket differently from HTTP/1.0.

In the RFC 2616, Section 3.6 defines:

[...]
All HTTP/1.1 applications MUST be able to receive and decode the "chunked" transfer-coding,
[...]


EDIT: (it has something to do with chunked data)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum