Http Response utilities.
More...
Http Response utilities.
- Author
- jc
- Version
- 1.0.0.0
Definition at line 11 of file UResponse.php.
◆ _headerArray()
static _headerArray |
( |
|
$headerField, |
|
|
|
$values |
|
) |
| |
|
staticprivate |
- Parameters
-
string | $headerField | |
mixed | $values | |
Definition at line 29 of file UResponse.php.
◆ asHtml()
static asHtml |
( |
|
$encoding = 'utf-8' | ) |
|
|
static |
Sets the response content-type to text/html.
- Parameters
-
string | $encoding | default: utf-8 |
Definition at line 70 of file UResponse.php.
◆ asJSON()
Sets the response content-type to application/json.
Definition at line 62 of file UResponse.php.
◆ asText()
static asText |
( |
|
$encoding = 'utf-8' | ) |
|
|
static |
Sets the response content-type to plain/text.
- Parameters
-
string | $encoding | default: utf-8 |
Definition at line 86 of file UResponse.php.
◆ asXml()
static asXml |
( |
|
$encoding = 'utf-8' | ) |
|
|
static |
Sets the response content-type to application/xml.
- Parameters
-
string | $encoding | default: utf-8 |
Definition at line 78 of file UResponse.php.
◆ getResponseCode()
static getResponseCode |
( |
| ) |
|
|
static |
◆ header()
static header |
( |
|
$headerField, |
|
|
|
$value, |
|
|
|
$replace = null , |
|
|
|
$responseCode = null |
|
) |
| |
|
static |
Send a raw HTTP header.
- Parameters
-
string | $headerField | the header field |
string | $value | the header value |
boolean | $replace | The optional replace parameter indicates whether the header should replace a previous similar header |
int | $responseCode | Forces the HTTP response code to the specified value |
Definition at line 20 of file UResponse.php.
◆ isSent()
Checks if or where headers have been sent.
- Returns
- boolean
Definition at line 55 of file UResponse.php.
◆ noCache()
Forces the disabling of the browser cache.
Definition at line 46 of file UResponse.php.
◆ setAccept()
static setAccept |
( |
|
$value | ) |
|
|
static |
◆ setAccessControlHeaders()
static setAccessControlHeaders |
( |
|
$headers | ) |
|
|
static |
Sets the Access-Control-Allow-Headers field value.
- Parameters
-
Definition at line 119 of file UResponse.php.
◆ setAccessControlMethods()
static setAccessControlMethods |
( |
|
$methods | ) |
|
|
static |
Sets the Access-Control-Allow-Methods field value.
- Parameters
-
Definition at line 111 of file UResponse.php.
◆ setAccessControlOrigin()
static setAccessControlOrigin |
( |
|
$origin | ) |
|
|
static |
Sets the Access-Control-Allow-Origin field value.
- Parameters
-
Definition at line 103 of file UResponse.php.
◆ setAuthorization()
static setAuthorization |
( |
|
$authorization | ) |
|
|
static |
Set the Authorization header field.
- Parameters
-
Definition at line 127 of file UResponse.php.
◆ setContentType()
static setContentType |
( |
|
$contentType, |
|
|
|
$encoding = null |
|
) |
| |
|
static |
◆ setResponseCode()
static setResponseCode |
( |
|
$value | ) |
|
|
static |
Sets the response code.
- Parameters
-
Definition at line 135 of file UResponse.php.
The documentation for this class was generated from the following file: