ariyx/http-client

A small PSR-18 HTTP client backed by cURL.

Maintainers

Package info

github.com/ariyx/HttpClient

Issues

pkg:composer/ariyx/http-client

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 1

v3.0.0 2026-08-16 08:54 UTC

This package is auto-updated.

Last update: 2026-08-16 08:58:00 UTC


README

A small, standards-based PSR-18 HTTP client for PHP, backed by cURL.

Requirements

PHP 8.3+ and ext-curl.

Installation

composer require ariyx/http-client

Usage

use Ariyx\HttpClient\Client;
use Nyholm\Psr7\Request;

$client = Client::create();
$request = new Request('GET', 'https://example.com');
$response = $client->sendRequest($request);

echo $response->getStatusCode();
echo $response->getBody();

Retry transient failures with the included client middleware:

use Ariyx\HttpClient\Middleware\RetryMiddleware;

$client = Client::create(middleware: [new RetryMiddleware()]);

Error handling

HTTP 4xx and 5xx responses are returned normally. Network and invalid-request failures throw PSR-18 compatible exceptions.

Development

composer check

License

MIT