marko/http

HTTP client contracts for Marko Framework

Maintainers

Package info

github.com/marko-php/marko-http

Type:marko-module

pkg:composer/marko/http

Statistics

Installs: 0

Dependents: 2

Suggesters: 0

Stars: 0

0.0.1 2026-03-25 17:53 UTC

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