Request
in package
The LDC CRM request Contains the http method, the requested url and data to pass
Tags
Table of Contents
- $data : array<string|int, mixed>
- $headers : array<string|int, mixed>
- $method : HttpMethods
- $uri : string
- $data : array<string|int, mixed>
- Data to pass to the http body
- $headers : array<string|int, mixed>
- Data to pass to the http headers
- $method : HttpMethods
- The http method
- $uri : string
- The http url
- $client : Client
- GuzzleHttp client
- $endpoint : string
- The Api endpoint
- $request : callable
- Guzzle request
- __construct() : mixed
- Request
- __get() : mixed|null
- Generic accessor
- addData() : void
- Add data to the request
- addHeaders() : void
- Add headers to the request
- call() : ResponseInterface
- Make the Http request
- setEndpoint() : void
- Set the api endpoint to the request
- makeRequest() : void
- make the guzzle request
Properties
$data
public
array<string|int, mixed>
$data
readonly data
$headers
public
array<string|int, mixed>
$headers
headers
$method
public
HttpMethods
$method
readonly method
$uri
public
string
$uri
readonly uri
$data
Data to pass to the http body
protected
array<string|int, mixed>
$data
= []
$headers
Data to pass to the http headers
protected
array<string|int, mixed>
$headers
= []
$method
The http method
protected
HttpMethods
$method
$uri
The http url
protected
string
$uri
$client
GuzzleHttp client
private
Client
$client
$endpoint
The Api endpoint
private
string
$endpoint
$request
Guzzle request
private
callable
$request
the returns \GuzzleHttp\Psr7\Request
Methods
__construct()
Request
public
__construct(HttpMethods $method, string $uri[, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $method : HttpMethods
- $uri : string
- $headers : array<string|int, mixed> = []
- $data : array<string|int, mixed> = []
Return values
mixed —__get()
Generic accessor
public
__get(string $field) : mixed|null
Parameters
- $field : string
Return values
mixed|null —addData()
Add data to the request
public
addData(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Return values
void —addHeaders()
Add headers to the request
public
addHeaders(array<string|int, mixed> $headers) : void
Parameters
- $headers : array<string|int, mixed>
Return values
void —call()
Make the Http request
public
call() : ResponseInterface
Return values
ResponseInterface —setEndpoint()
Set the api endpoint to the request
public
setEndpoint(string $endpoint) : void
Parameters
- $endpoint : string
Return values
void —makeRequest()
make the guzzle request
private
makeRequest() : void