dev-master
9999999-devSimple wrapper for cURL for basic requests
The Requires
- ext-curl *
The Development Requires
by Christopher Valderrama
curl http request
Wallogit.com
2017 © Pedro Peláez
Simple wrapper for cURL for basic requests
Simple PHP Http Request Wrapper using cURL under the hood., (*1)
$ php composer.phar require gatorv/simple-http
Basic Usage, (*2)
use Gatorv\Web\SimpleHttpRequest as Request;
$req = new Request();
list($headers, $body) = $req->get('https://url/');
Perform a GET Request, (*3)
$req->get($url);
Perform a POST Request:, (*4)
$req->post($url, $data);
The following options can be customized on constructing the object (or after construction: 1. redirects - The number of redirects to perform if a Location header is sent. 1. proxy - The proxy and port to use 1. ssl - Wether to verify the SSL certificate or not (for testing), (*5)
Also the following methods are available:, (*6)
Use a Desktop User-Agent:, (*7)
$req->useDesktopAgent();
Use a Mobile User-Agent:, (*8)
$req->useMobileAgent();
Reset Headers:, (*9)
$req->resetHeaders();
Request Compression:, (*10)
$req->requestCompression();
Add a HTTP Cookie:, (*11)
$req->addCookie();
Simple wrapper for cURL for basic requests
curl http request