Client
in package
Class Client.
Tags
Table of Contents
- $parsed : array<string|int, mixed>
- createRequest() : Request
- Create a new Request instance.
- run() : Response
- Run the Request.
- runMulti() : Generator<string|int, \Framework\HTTP\Client\Response|\Framework\HTTP\Client\ResponseError>
- Run multiple HTTP Requests.
- parseHeaderLine() : int
- Parses Header line.
Properties
$parsed
protected
array<string|int, mixed>
$parsed
= []
Methods
createRequest()
Create a new Request instance.
public
createRequest(URL|string $url) : Request
Parameters
- $url : URL|string
Return values
Request —run()
Run the Request.
public
run(Request $request) : Response
Parameters
- $request : Request
Tags
Return values
Response —runMulti()
Run multiple HTTP Requests.
public
runMulti(array<string|int, Request> $requests) : Generator<string|int, \Framework\HTTP\Client\Response|\Framework\HTTP\Client\ResponseError>
Parameters
- $requests : array<string|int, Request>
-
An associative array of Request instances with ids as keys
Return values
Generator<string|int, \Framework\HTTP\Client\Response|\Framework\HTTP\Client\ResponseError> —The Requests ids as keys and its respective Response or ResponseError as values
parseHeaderLine()
Parses Header line.
protected
parseHeaderLine(CurlHandle $curlHandle, string $line) : int
Parameters
- $curlHandle : CurlHandle
- $line : string