HttpClient
HTTP requests, callbacks and parallel connections.
Installation
Section titled “Installation”composer config repositories.localzet-httpclient vcs https://github.com/localzet/HttpClientcomposer require localzet/http:dev-mainHTTP client
Section titled “HTTP client”The main class is localzet\HTTP\Client, not AsyncClient. request($url, $method = 'GET', $data = [], $headers = [], $options = []) is the general entry point; get() and post() also accept success/error callbacks. ParallelClient::push()/batch() collect requests and await($errorThrow = false) collects results. Consult Client/Request at the pinned revision for exact options.
The client depends on Server 4.x, localzet/psr7 and ext-curl. Do not automatically reuse Server 7 recipes or confuse its Response with the client’s PSR-7 objects. Bound time, response size and concurrency; handle transport errors separately from HTTP 4xx/5xx.
For user-supplied URLs, restrict schemes/addresses and recheck redirects as an SSRF boundary. TLS verification, redirects, streaming, cancellation and pool cleanup still require integration tests; class availability does not establish those guarantees.
Requirements
Section titled “Requirements”- php: ^8.0
- ext-curl: *
- ext-json: *
- localzet/server: ^4.2
- localzet/psr7: ^3.0
- psr/http-message: ^2.0
Source · AGPL-3.0