--FILE--
<?php
echo "-TEST\n";
+
$pool = new HttpRequestPool(
new HttpRequest('http://www.php.net/', HTTP_METH_HEAD),
new HttpRequest('http://at.php.net/', HTTP_METH_HEAD),
new HttpRequest('http://ch.php.net/', HTTP_METH_HEAD),
$post = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST)
);
+
$post->addPostFields(array('a'=>1,'b'=>2)) ;
$pool->send();
+
foreach ($pool as $req) {
echo $req->getUrl(), '=',
$req->getResponseCode(), ':',
$req->getResponseMessage()->getResponseCode(), "\n";
}
+
foreach ($pool as $req) {
try {
$pool->attach(new HttpRequest('http://foo.bar'));
echo ".\n";
}
}
+
foreach ($pool as $req) {
$pool->detach($req);
}
+
echo "Done\n";
?>
+
--EXPECTF--
%sTEST
http://www.php.net/=200:200
$message =
"HTTP/1.1 200 Ok\n".
-"Content-Range: bytes=0-1/5\n\n".
+"Content-Range: bytes: 0-1/5\n\n".
"OK\n";
$msg = http_parse_message($message);
$message =
"HTTP/1.1 200 Ok\n".
-"Content-Range: bytes=0-1/1\n\n".
+"Content-Range: bytes 0-1/1\n\n".
"X\n";
$msg = http_parse_message($message);
--EXPECTF--
%sTEST
string(2) "OK"
-%s Invalid Content-Range header: bytes=0-1/1 in%s
+%s Invalid Content-Range header: bytes 0-1/1 in%s
Done
"
HTTP/1.1 206
Server: Funky/1.0
-Content-Range: bytes=0-0/100
+Content-Range: bytes: 0-0/100
1
[headers] => Array
(
[Server] => Funky/1.0
- [Content-Range] => bytes=0-0/100
+ [Content-Range] => bytes: 0-0/100
)
[body] => 1