Download the PHP package utopia-php/client without Composer
On this page you can find all versions of the php package utopia-php/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package client
Utopia Client
[!IMPORTANT] This repository is a read-only mirror of the utopia-php monorepo. Development happens in
packages/client— please open issues and pull requests there.
A small PSR-18 HTTP client for PHP 8.4+. cURL and Swoole coroutine transports, using utopia-php/psr7 for PSR-7 messages and request/response helpers.
Install
Use ext-curl for the cURL adapter and ext-swoole for the Swoole coroutine adapter.
Quick start
Utopia\Client implements Psr\Http\Client\ClientInterface, so it works anywhere a PSR-18 client is expected. HTTP/1.1 is used by default and redirects are not followed unless you call withFollowRedirects(), so you receive exactly the response the server returned.
The concrete Utopia\Psr7 messages and factories are provided by the utopia-php/psr7 dependency.
Configure the client
Defaults are immutable — each with*() returns a configured clone, and a default never overrides a header already set on the request.
Build requests
Pass a 4th $headers array to any factory method to override defaults, such as a custom Content-Type or Accept.
Decode responses
HTTP 4xx and 5xx responses are returned, not thrown, as required by PSR-18.
More
- Streaming — consume large downloads (SSE, LLM token streams) and upload large files, both with bounded memory.
- Retries — the
Retrydecorator and its configurable best-practice backoff strategy. - Pooling — share a bounded set of reused connections across concurrent callers with
Pool. - Configuration — timeouts, TLS, connection reuse, native cURL options, and the Swoole coroutine adapter.
- Error handling — the PSR-18 exception hierarchy the adapters throw.
- Development — running the test suite and checks.
All versions of client with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
utopia-php/pools Version ^2.0
utopia-php/psr7 Version ^0.2.1
utopia-php/span Version ^1.1 || ^3.0 || ^4.0