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
- $attemps : int
- Current attempt to login
- $data : array<string|int, mixed>
- Data to pass to the http body
- $headers : array<string|int, mixed>
- Data to pass to the http headers
- $maxAttemps : int
- Max attemps to login
- $method : HttpMethods
- The http method
- $uri : string
- The http url
- $client : Client
- GuzzleHttp client
- $endpoint : string
- The Api endpoint
- $hidden : callable
- Hidden props
- $request : callable
- Guzzle request
- __construct() : mixed
- __get() : mixed
- addData() : void
- Add data to the request
- addHeaders() : void
- Add headers to the request
- call() : ResponseInterface
- Make the Http request
- getAttempts() : int
- Get attempted calls
- incrementAttempt() : int
- Increment the attempt to call
- maxAttempted() : int
- Does max attempts have been reached
- setEndpoint() : void
- Set the api endpoint to the request
- setHidden() : void
- Set hidden header and data
- 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
$attemps
Current attempt to login
protected
int
$attemps
= 0
$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
= []
$maxAttemps
Max attemps to login
protected
int
$maxAttemps
= 1
$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
$hidden
Hidden props
private
callable
$hidden
$request
Guzzle request
private
callable
$request
the returns \GuzzleHttp\Psr7\Request
Methods
__construct()
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()
public
__get(mixed $field) : mixed
Parameters
- $field : mixed
Return values
mixed —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 —getAttempts()
Get attempted calls
public
getAttempts() : int
Return values
int —incrementAttempt()
Increment the attempt to call
public
incrementAttempt() : int
Return values
int —maxAttempted()
Does max attempts have been reached
public
maxAttempted() : int
Return values
int —setEndpoint()
Set the api endpoint to the request
public
setEndpoint(string $endpoint) : void
Parameters
- $endpoint : string
Return values
void —setHidden()
Set hidden header and data
public
setHidden(array<string|int, mixed> $array) : void
Parameters
- $array : array<string|int, mixed>
Return values
void —makeRequest()
make the guzzle request
private
makeRequest() : void