API Services HttpServiceInterface - evansims/openfga-php GitHub Wiki
Service for handling HTTP communication. This service abstracts HTTP operations from the Client class, providing a clean interface for sending requests and managing HTTP-related state like last request/response tracking.
Table of Contents
OpenFGA\Services
- HttpService (implementation)
public function getLastRequest(): HttpRequestInterface|null
Get the last HTTP request sent. Returns the most recent HTTP request sent by this service, useful for debugging and error reporting.
HttpRequestInterface
| null
— The last request, or null if no requests sent
public function getLastResponse(): HttpResponseInterface|null
Get the last HTTP response received. Returns the most recent HTTP response received by this service, useful for debugging and error reporting.
HttpResponseInterface
| null
— The last response, or null if no responses received
public function send(RequestInterface $request): HttpResponseInterface
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.
Name | Type | Description |
---|---|---|
$request |
RequestInterface |
The OpenFGA request to send |
HttpResponseInterface
— The HTTP response