Re: Simple HTTP request, with "Range" header

From: Date: Wed, 13 Aug 2003 15:38:21 +0000
Subject: Re: Simple HTTP request, with "Range" header
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-159446@lists.php.net to get a copy of this message
--- Curt Zirzow <curt@zirzow.dyndns.org> wrote: > The problem with dealing with HTTP/1.1 is you have to make sure > your script is HTTP/1.1 compliant, which there are a lot of > gotchas to deal with. In most cases, extra features (or gotchas) in HTTP/1.1 have to be requested via one of the Accept-* headers, so it's more forgiving than you might think if you just use something very plain like: GET / HTTP/1.1 Host: example.org > For example, some web servers will send back the data in chunks > instead of just stream the file to you. So you have to parse the > size of the chunk and then fread that size into your buffer. For this specific case, you have to tell the server that you can accept chunked transfers. If you don't, it should just use Content-Length. > Now I think you can get by with a range: header when you request > a document as HTTP/1.0, its been a while since I've acually done > that so cant remember if I had to use HTTP/1.1 or not. It wasn't part of the HTTP/1.0 specification, but that doesn't mean a whole lot when it comes to implementations. :-) Many HTTP/1.0 agents have had HTTP/1.1 features added. As an example, most HTTP/1.0 requests include the Host header, because it is required in HTTP/1.1. Hope that helps. Chris ===== Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/

« previous php.general (#159446) next »