Note that this is not an HTTP protocol implementation of its own. It is merely a wrapper of libcurl that implements PSR-7 HTTP message interface.
- PHP 5.4 or newer
- cURL extension
composer require matricali/http-client
use Matricali\Http\Client;
$client = new Client();
$response = $client->get('http://www.example.com/');
echo $response->getBody();
use Matricali\Http\Client;
$client = new Client();
$payload = '{"name": "John Doe"}';
$response = $client->post('http://www.example.com/', $payload);
echo $response->getBody();
Contributions, issues, pull requests are welcome. See CONTRIBUTING.md
php-http-client is MIT licensed.