API Services HttpService - evansims/openfga-php GitHub Wiki

Default implementation of HttpServiceInterface. This implementation delegates to RequestManager for actual HTTP operations, providing a clean abstraction layer between the Client and network concerns. It emits events for telemetry and observability without direct coupling.

Table of Contents


Namespace

OpenFGA\Services


Source

View source code


Implements


Related Classes


Methods

getLastRequest

public function getLastRequest(): ?Psr\Http\Message\RequestInterface

Get the last HTTP request sent. Returns the most recent HTTP request sent by this service, useful for debugging and error reporting.

View source


Returns

Psr\Http\Message\RequestInterface | null — The last request, or null if no requests sent


getLastResponse

public function getLastResponse(): ?Psr\Http\Message\ResponseInterface

Get the last HTTP response received. Returns the most recent HTTP response received by this service, useful for debugging and error reporting.

View source


Returns

Psr\Http\Message\ResponseInterface | null — The last response, or null if no responses received


send

public function send(OpenFGA\Requests\RequestInterface $request): Psr\Http\Message\ResponseInterface

Send an HTTP request. Sends a request to the OpenFGA API and returns the response. This method handles all HTTP-level concerns including authentication, retries, and error handling.

View source


Parameters

Name Type Description
$request RequestInterface The OpenFGA request to send

Returns

Psr\Http\Message\ResponseInterface — The HTTP response

⚠️ **GitHub.com Fallback** ⚠️