marko / http
HTTP client contracts for Marko Framework
0.0.1
2026-03-25 17:53 UTC
Requires
- php: ^8.5
- marko/core: 0.0.1
Requires (Dev)
- pestphp/pest: ^4.0
This package is auto-updated.
Last update: 2026-03-25 21:07:35 UTC
README
Contracts for HTTP requests — type-hint against HttpClientInterface so your code works with any HTTP driver.
Installation
composer require marko/http
Note: You also need an implementation package such as marko/http-guzzle.
Quick Example
use Marko\Http\Contracts\HttpClientInterface; class PaymentGateway { public function __construct( private HttpClientInterface $httpClient, ) {} public function charge(float $amount): array { $response = $this->httpClient->post('https://api.payments.com/charge', [ 'json' => ['amount' => $amount], ]); return $response->json(); } }
Documentation
Full usage, API reference, and examples: marko/http