--SKIPIF--
<?php
include "skip.inc";
+checkurl("www.google.com");
checkcls("HttpRequestDataShare");
?>
--FILE--
--SKIPIF--
<?php
include "skip.inc";
+checkurl("www.google.com");
checkcls("HttpRequestDataShare");
?>
--FILE--
checkmin(5);
checkcls('HttpRequestPool');
checkurl('www.php.net');
-checkurl('de.php.net');
-checkurl('at.php.net');
checkurl('dev.iworks.at');
?>
--FILE--
<?php
echo "-TEST\n";
-$post = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$post = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
$post->addPostFields(array('a'=>1,'b'=>2)) ;
$pool = new HttpRequestPool(
new HttpRequest('http://www.php.net/', HTTP_METH_HEAD),
- new HttpRequest('http://at.php.net/', HTTP_METH_HEAD),
- new HttpRequest('http://de.php.net/', HTTP_METH_HEAD),
$post
);
--EXPECTF--
%sTEST
http://www.php.net/=200:200
-http://at.php.net/=200:200
-http://de.php.net/=200:200
-http://dev.iworks.at/.print_request.php=200:200
-.
-.
+http://dev.iworks.at/ext-http/.print_request.php=200:200
.
.
Done
<?php
include 'skip.inc';
checkcls('HttpRequestPool');
-checkurl('at.php.net');
-checkurl('de.php.net');
checkurl('www.php.net');
?>
--FILE--
$pool = new MyPool(
new HttpRequest('http://www.php.net/', HTTP_METH_HEAD),
- new HttpRequest('http://at.php.net/', HTTP_METH_HEAD),
- new HttpRequest('http://de.php.net/', HTTP_METH_HEAD)
+ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD),
+ new HttpRequest('http://www.php.net/', HTTP_METH_HEAD)
);
$pool->send();
$r->send();
print_r($r->getResponseInfo());
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
$r->addCookies(array('MyCookie' => 'foobar'));
$r->addQueryData(array('gq'=>'foobar','gi'=>10));
$r->addPostFields(array('pq'=>'foobar','pi'=>10));
);
echo "\nFirst Request\n";
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HttpRequest::METH_POST);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_POST);
$r->setPostFields($fields[0]);
$r->addPostFields($fields[1]);
var_dump($r->send()->getBody());
<?php
echo "-TEST\n";
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
$r->setContentType('text/xml');
$r->setBody(xmlrpc_encode_request('testMethod', array('foo' => 'bar')));
var_dump($r->send());
<?php
echo "-TEST\n";
-$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
$r->recordHistory = true;
$r->addHeaders(array('content-type' => 'text/plain'));
$r->setPutFile(__FILE__);
?>
--EXPECTF--
%sTEST
-string(%d) "PUT /.print_put.php5 HTTP/1.1
+string(%d) "PUT /ext-http/.print_put.php5 HTTP/1.1
User-Agent: PECL::HTTP/%s
Host: dev.iworks.at
Accept: */*
Content-Type: text/plain
-Content-Length: 281
+Content-Length: %d
Expect: 100-continue
<?php
echo "-TEST\n";
-$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
$r->recordHistory = true;
$r->addHeaders(array('content-type' => 'text/plain'));
$r->setPutFile(__FILE__);
Server: %s
X-Powered-By: %s
Vary: Accept-Encoding
+Content-Length: %d
Content-Type: text/html
-X-Original-Transfer-Encoding: chunked
-Content-Length: 281
<?php
echo "-TEST\n";
-$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
$r->recordHistory = true;
$r->addHeaders(array('content-type' => 'text/plain'));
$r->setPutFile(__FILE__);
echo "-TEST\n";
HttpRequest::methodRegister('foobar');
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HttpRequest::METH_FOOBAR);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HttpRequest::METH_FOOBAR);
$r->setContentType('text/plain');
$r->setBody('Yep, this is FOOBAR!');
var_dump($r->send()->getResponseCode());
--EXPECTF--
%sTEST
int(200)
-string(%d) "FOOBAR /.print_request.php HTTP/1.1
+string(%d) "FOOBAR /ext-http/.print_request.php HTTP/1.1
User-Agent: %s
Host: dev.iworks.at
Accept: */*
}
}
-$r = new _R('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r = new _R('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
$r->addPostFile('upload', __FILE__, 'text/plain');
$r->send();
<?php
echo "-TEST\n";
-$r = new HttpRequest("http://dev.iworks.at/.cookie.php");
+$r = new HttpRequest("http://dev.iworks.at/ext-http/.cookie.php");
$r->send();
$c[0] = $r->getResponseInfo("cookies");
$cookies = array("name" => "val=ue");
-$r = new HttpRequest("http://dev.iworks.at/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies));
+$r = new HttpRequest("http://dev.iworks.at/ext-http/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies));
$r->recordHistory = true;
$r->send();
$r->setOptions(array('encodecookies' => false));
?>
--EXPECTF--
%sTEST
-GET /.print_request.php HTTP/1.1
+GET /ext-http/.print_request.php HTTP/1.1
User-Agent: %s
Host: dev.iworks.at
Accept: */*
[name] => val=ue
)
-GET /.print_request.php HTTP/1.1
+GET /ext-http/.print_request.php HTTP/1.1
User-Agent: %s
Host: dev.iworks.at
Accept: */*
<?php
echo "-TEST\n";
-var_dump(http_parse_message(http_get('http://dev.iworks.at/.print_request.php?gzip=1', array('compress' => true))));
+var_dump(http_parse_message(http_get('http://dev.iworks.at/ext-http/.print_request.php?gzip=1', array('compress' => true))));
echo "Done\n";
--EXPECTF--
<?php
echo "-TEST\n";
-var_dump(str_repeat("abc", 6000) === http_parse_message(http_put_data("http://dev.iworks.at/.print_put.php5", str_repeat("abc", 6000/* > CURLBUF_SIZE */)))->body);
+var_dump(str_repeat("abc", 6000) === http_parse_message(http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", str_repeat("abc", 6000/* > CURLBUF_SIZE */)))->body);
echo "Done\n";
?>