Http
in package
uses
LoggerAware
Table of Contents
Properties
- $logger : mixed
Methods
- getLogger() : mixed
- parseAcceptHeader() : array<string|int, string>
- Parses one of the http headers which can have a list of values with quality param.
- parseResponseHeaders() : array<string|int, mixed>
- Parses HTTP an http response's headers and separates them from the body.
- setLogger() : void
Properties
$logger
protected
static mixed
$logger
Methods
getLogger()
public
getLogger() : mixed
parseAcceptHeader()
Parses one of the http headers which can have a list of values with quality param.
public
parseAcceptHeader(string $header) : array<string|int, string>
Parameters
- $header : string
Tags
Return values
array<string|int, string>parseResponseHeaders()
Parses HTTP an http response's headers and separates them from the body.
public
parseResponseHeaders(string &$data[, bool $headersProcessed = false ][, int $debug = 0 ]) : array<string|int, mixed>
Parameters
- $data : string
-
the http response, headers and body. It will be stripped of headers
- $headersProcessed : bool = false
-
when true, we assume that response inflating and dechunking has been already carried out
- $debug : int = 0
-
when > 0, logs to screen messages detailing info about the parsed data
Tags
Return values
array<string|int, mixed> —with keys 'headers', 'cookies', 'raw_data' and 'status_code'
setLogger()
public
static setLogger(mixed $logger) : void
Parameters
- $logger : mixed