Class Response
A service that handles the HTTP response data
- Wei\Base
- Wei\Response
public
|
|
public
|
|
public
|
|
public
mixed
|
|
public
|
|
public
|
|
public
integer
|
|
public
|
|
public
string
|
|
public
|
|
public
mixed
|
|
public
|
|
public
boolean
|
|
protected
|
|
public
boolean
|
#
isHeaderSent( string & $file = null, integer & $line = null )
Checks if or where headers have been sent |
public
mixed
|
|
public
|
|
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
__call(),
__construct(),
__get(),
getOption(),
setOption()
|
protected
array
|
$statusTexts
Common use HTTP status code and text |
#
array(
// Successful Requests
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
// Redirects
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
307 => 'Temporary Redirect',
// Client Errors
401 => 'Unauthorized',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Timeout',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Long',
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
// Server Errors
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported'
)
|
protected
string
|
$version
The HTTP version, current is 1.0 or 1.1 |
#
'1.1'
|
protected
integer
|
$statusCode
The status code |
#
200
|
protected
string
|
$statusText
The status text for status code |
#
'OK'
|
protected
string
|
$content
The response content |
|
protected
array
|
$headers
The response headers |
#
array()
|
protected
array
|
$sentHeaders
The sent response headers |
#
array()
|
protected
array
|
$cookies
The response cookies |
#
array()
|
protected
array
|
$cookieOption
The cookie options |
#
array(
'expires' => 864000,
'path' => '/',
'domain' => null,
'secure' => false,
'httpOnly' => false,
'raw' => false,
)
|
protected
array
|
$downloadOption
The download options |
#
array(
'type' => 'application/x-download',
'disposition' => 'attachment',
'filename' => null,
)
|
protected
boolean
|
$unitTest
Whether in unit test mode |
#
false
|
protected
string
|
$redirectView
The custom redirect view file |
|
protected
integer
|
$redirectWait
The seconds to wait before redirect |
#
0
|
protected
callable
|
$beforeSend
The callback executes before send response |
|
protected
callable
|
$afterSend
The callback executes after sent response |
$providers,
$wei
|
public
|
$logger
The logger service |
public
|
$request
The request service |