RequestSender
extends AbstractApiResourceGroup
in package
implements
RequestSenderInterface
Uses
BaseUrlAwareTrait
Class RequestSender
Tags
Table of Contents
Interfaces
- RequestSenderInterface
- Interface RequestSenderInterface
Methods
- __construct() : mixed
- host() : string
- Returns host from the base URL.
- route() : string
- Returns API routes with base URI prepended.
- send() : array<int|string, mixed>
- Sends custom request to provided route with provided method and body, returns array response.
Methods
__construct()
public
__construct(AbstractApiResourceGroup $resourceGroup) : mixed
Parameters
- $resourceGroup : AbstractApiResourceGroup
host()
Returns host from the base URL.
public
host() : string
Tags
Return values
stringroute()
Returns API routes with base URI prepended.
public
route(string $route) : string
Parameters
- $route : string
Tags
Return values
stringsend()
Sends custom request to provided route with provided method and body, returns array response.
public
send(string $method, string $route[, array<int|string, mixed> $requestForm = [] ]) : array<int|string, mixed>
Request will be put into GET parameters or into POST form-data (depends on method).
Note: do not remove "useless" exceptions which are marked as "never thrown" by IDE. PSR-18's ClientInterface doesn't have them in the DocBlock, but, according to PSR-18, they can be thrown by clients, and therefore should be present here.
Parameters
- $method : string
- $route : string
- $requestForm : array<int|string, mixed> = []