#24505 [Com]: feature request: http_request() function
ID: 24505
Comment by: rwilliams at warren-wilson dot edu
Reported By: firewolf at pochtampt dot ru
Status: Assigned
Bug Type: Feature/Change Request
Operating System: FreeBSD-4.8
PHP Version: 4.3.3RC1
Assigned To: wez
New Comment:
I would like to see this bug amended. I don't see how it
would require overloading to address the issue but only
the change in the switch statement as pictured.
Previous Comments:
------------------------------------------------------------------------
[2003-11-29 09:11:56] wez@php.net
Change summary
------------------------------------------------------------------------
[2003-07-05 03:22:06] wez@php.net
We won't be overloading fopen() to handle partial fetches.
However, we are looking at adding some kind of http_request() function
that can include this kind of feature.
------------------------------------------------------------------------
[2003-07-05 00:23:11] firewolf at pochtampt dot ru
Description:
------------
function fopen(),
when I open http://somesite/somefile
I can't use reget, because server response:
HTTP/1.0 206 Partial content... and php log error.
Its possible when I make content:
$opts = array('http'=>array('user_agent'
=> "USER_AGET NAME\r\nRange: bytes=2000-\r\n"));
$context = stream_context_create($opts);
$fl = fopen("$url","r",false,$context);
Reproduce code:
---------------
php-4.3.3RC1/ext/standard/http_fopen_wrapper.c.orig:
...
line 300:
switch(response_code) {
case 200:
case 302:
case 301:
reqok = 1;
break;
case 403:
Expected result:
----------------
php-4.3.3RC1/ext/standard/http_fopen_wrapper.c.orig:
...
line 300:
switch(response_code) {
case 200:
case 206:
case 302:
case 301:
reqok = 1;
break;
case 403:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24505&edit=1
Thread (6 messages)