gatorv / simple-http
Simple wrapper for cURL for basic requests
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/gatorv/simple-http
Requires
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ^6.2
This package is not auto-updated.
Last update: 2025-10-12 08:09:44 UTC
README
Simple PHP Http Request Wrapper using cURL under the hood.
Installation
$ php composer.phar require gatorv/simple-http
Usage
Basic Usage
use Gatorv\Web\SimpleHttpRequest as Request; $req = new Request(); list($headers, $body) = $req->get('https://url/');
Main Methods
Perform a GET Request
$req->get($url);
Perform a POST Request:
$req->post($url, $data);
Methods
The following options can be customized on constructing the object (or after construction:
- redirects - The number of redirects to perform if a Location header is sent.
- proxy - The proxy and port to use
- ssl - Wether to verify the SSL certificate or not (for testing)
Also the following methods are available:
Use a Desktop User-Agent:
$req->useDesktopAgent();
Use a Mobile User-Agent:
$req->useMobileAgent();
Reset Headers:
$req->resetHeaders();
Request Compression:
$req->requestCompression();
Add a HTTP Cookie:
$req->addCookie();