Download the PHP package jardisadapter/http without Composer
On this page you can find all versions of the php package jardisadapter/http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jardisadapter/http
More information about jardisadapter/http
Files in jardisadapter/http
Package http
Short Description PSR-18 HTTP client with cURL transport, Bearer and Basic auth, retry with exponential backoff, and minimal footprint; a building block of the open-source foundation that Jardis-generated DDD code runs on
License MIT
Homepage https://jardis.io
Informations about the package http
Jardis HTTP Client
Part of Jardis — the Domain-Driven Design platform for PHP. You model your domain; Jardis generates the production-ready hexagonal code (DTOs, Command/Query handlers, repositories, persistence). This package is part of the open-source foundation that generated code runs on.
HTTP requests without overhead. A lean PSR-18 HTTP client for PHP built on cURL — designed for applications that call external APIs, send webhooks, or integrate services. No framework, no middleware stack, no dependency bloat. Just what you need.
Why This Client?
- Two classes to learn —
HttpClient+ClientConfig. Includes its own PSR-7/PSR-17 implementation — zero external dependencies - Handler pipeline — each concern is its own invokable, orchestrated internally by the client
- Retry with backoff — automatic retry on 5xx and network errors
- PSR-18 compatible — works with any PSR-18-capable code
- 96% test coverage — integration tests against real HTTP requests, not mocks
Installation
Quick Start
GET Request
POST with JSON Body
PUT, PATCH, DELETE
Custom Headers per Request
Fully Configured
Authentication
Bearer Token
Basic Auth
Retry
Automatically retries on HTTP 5xx and transport errors (HttpClientException, which covers both NetworkException and RequestException). No retry on 4xx — those are caller errors.
Error Handling
The client does not throw exceptions on HTTP 4xx/5xx — those are valid responses. Exceptions are only thrown for actual errors:
| Exception | When |
|---|---|
NetworkException |
DNS failure, connection refused, timeout |
RequestException |
Invalid request (malformed URI) |
PSR-18 Compatible
The client implements Psr\Http\Client\ClientInterface. For full control over the request, use sendRequest():
Architecture
The user only sees HttpClient + ClientConfig. Internally, the client orchestrates a pipeline of invokable handlers — built from the config:
Each handler is an invokable object (__invoke) — independently testable, replaceable, composable. Only what is configured gets instantiated.
Custom Transport
The transport is a closure — replaceable without changing the client:
Jardis Kernel Integration
jardiscore/kernel provides JardisCore\Kernel\Bootstrap\Handler\BuildHttpClientFromEnv, packed by the Bootstrap-Packer Bootstrap\BuildDomainKernelFromEnv.
In a Jardis DDD project, the client is automatically configured via ENV:
Your domain code receives the client via the accessor $kernel->httpClient(): ?ClientInterface — without ever importing HttpClient directly. The return value is either the instance or null — a third state does not exist, since the accessor is typed ?ClientInterface. null means: the adapter is not installed.
Development
Documentation
Full documentation, guides, and API reference:
docs.jardis.io/en/adapter/http
License
MIT License — free for any use, including commercial.
AI-Assisted Development
This package ships with a skill for Claude Code, Cursor, Continue, and Aider. Install it in your consuming project:
More details: https://docs.jardis.io/en/skills
All versions of http with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0
ext-curl Version *