Headers extends Client
Table of Contents
- __construct() : mixed
- Get the headers.
- curl() : mixed
- Access to curl clients.
- get() : bool|string
- Determine if header exists.
- gets() : bool|string
- Get all headers.
- has() : bool
- Get the header by key.
- normalizeKey() : string
- Normalize header name.
- remove() : void
- Remove the header by key.
- send() : void
- Send response.
- sendHeaders() : void
- Send headers.
- setHeader() : void
- append new header.
- setHeaders() : object
- Set response headers.
- update() : void
- Update existing header.
Methods
__construct()
Get the headers.
public
__construct() : mixed
Tags
Return values
mixed —curl()
Access to curl clients.
public
curl((string) $url[, mixed $method = 'GET' ][, array<string|int, mixed> $options = null ]) : mixed
Parameters
- $url : (string)
-
(string) $method (array) $options
- $method : mixed = 'GET'
- $options : array<string|int, mixed> = null
Tags
Return values
mixed —get()
Determine if header exists.
public
get((string) $key) : bool|string
Parameters
- $key : (string)
-
The header key
Tags
Return values
bool|string —gets()
Get all headers.
public
gets() : bool|string
Tags
Return values
bool|string —has()
Get the header by key.
public
has((string) $key) : bool
Parameters
- $key : (string)
-
The header key
Tags
Return values
bool —normalizeKey()
Normalize header name.
public
normalizeKey((string) $key) : string
Parameters
- $key : (string)
-
The case-insensitive header name
Return values
string —remove()
Remove the header by key.
public
remove((string) $key) : void
Parameters
- $key : (string)
-
The header key
Tags
Return values
void —send()
Send response.
public
send([(int) $code = null ][, (array) $headers = null ][, (bool) $compress = false ]) : void
Parameters
- $code : (int) = null
-
Status code.
- $headers : (array) = null
-
Headers.
- $compress : (bool) = false
-
Content compression.
Tags
Return values
void —sendHeaders()
Send headers.
public
sendHeaders() : void
Tags
Return values
void —setHeader()
append new header.
public
setHeader((string) $key, (string) $value) : void
Parameters
- $key : (string)
-
The header key.
- $value : (string)
-
The header value.
Tags
Return values
void —setHeaders()
Set response headers.
public
setHeaders((array) $headers) : object
Parameters
- $headers : (array)
Return values
object —update()
Update existing header.
public
update((string) $key, (string) $value) : void
Parameters
- $key : (string)
-
The header key
- $value : (string)
-
The new header value