interface IResponse

IHttpResponse interface.

Constants

PERMANENT

BROWSER

S100_CONTINUE

HTTP 1.1 response code

S101_SWITCHING_PROTOCOLS

HTTP 1.1 response code

S200_OK

HTTP 1.1 response code

S201_CREATED

HTTP 1.1 response code

S202_ACCEPTED

HTTP 1.1 response code

S203_NON_AUTHORITATIVE_INFORMATION

HTTP 1.1 response code

S204_NO_CONTENT

HTTP 1.1 response code

S205_RESET_CONTENT

HTTP 1.1 response code

S206_PARTIAL_CONTENT

HTTP 1.1 response code

S300_MULTIPLE_CHOICES

HTTP 1.1 response code

S301_MOVED_PERMANENTLY

HTTP 1.1 response code

S302_FOUND

HTTP 1.1 response code

S303_SEE_OTHER

HTTP 1.1 response code

S303_POST_GET

HTTP 1.1 response code

S304_NOT_MODIFIED

HTTP 1.1 response code

S305_USE_PROXY

HTTP 1.1 response code

S307_TEMPORARY_REDIRECT

HTTP 1.1 response code

S400_BAD_REQUEST

HTTP 1.1 response code

S401_UNAUTHORIZED

HTTP 1.1 response code

S402_PAYMENT_REQUIRED

HTTP 1.1 response code

S403_FORBIDDEN

HTTP 1.1 response code

S404_NOT_FOUND

HTTP 1.1 response code

S405_METHOD_NOT_ALLOWED

HTTP 1.1 response code

S406_NOT_ACCEPTABLE

HTTP 1.1 response code

S407_PROXY_AUTHENTICATION_REQUIRED

HTTP 1.1 response code

S408_REQUEST_TIMEOUT

HTTP 1.1 response code

S409_CONFLICT

HTTP 1.1 response code

S410_GONE

HTTP 1.1 response code

S411_LENGTH_REQUIRED

HTTP 1.1 response code

S412_PRECONDITION_FAILED

HTTP 1.1 response code

S413_REQUEST_ENTITY_TOO_LARGE

HTTP 1.1 response code

S414_REQUEST_URI_TOO_LONG

HTTP 1.1 response code

S415_UNSUPPORTED_MEDIA_TYPE

HTTP 1.1 response code

S416_REQUESTED_RANGE_NOT_SATISFIABLE

HTTP 1.1 response code

S417_EXPECTATION_FAILED

HTTP 1.1 response code

S426_UPGRADE_REQUIRED

HTTP 1.1 response code

S500_INTERNAL_SERVER_ERROR

HTTP 1.1 response code

S501_NOT_IMPLEMENTED

HTTP 1.1 response code

S502_BAD_GATEWAY

HTTP 1.1 response code

S503_SERVICE_UNAVAILABLE

HTTP 1.1 response code

S504_GATEWAY_TIMEOUT

HTTP 1.1 response code

S505_HTTP_VERSION_NOT_SUPPORTED

HTTP 1.1 response code

Methods

void
setCode($code)

Sets HTTP response code.

int
getCode()

Returns HTTP response code.

void
setHeader($name, $value)

Sends a HTTP header and replaces a previous one.

void
addHeader($name, $value)

Adds HTTP header.

void
setContentType($type, $charset = NULL)

Sends a Content-type HTTP header.

void
redirect($url, $code = self::S302_FOUND)

Redirects to a new URL.

void
setExpiration($seconds)

Sets the number of seconds before a page cached on a browser expires.

bool
isSent()

Checks if headers have been sent.

array
getHeaders()

Returns a list of headers to sent.

void
setCookie($name, $value, $expire, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL)

Sends a cookie.

void
deleteCookie($name, $path = NULL, $domain = NULL, $secure = NULL)

Deletes a cookie.

Details

at line 74
void setCode($code)

Sets HTTP response code.

Parameters

$code

Return Value

void

at line 80
int getCode()

Returns HTTP response code.

Return Value

int

at line 88
void setHeader($name, $value)

Sends a HTTP header and replaces a previous one.

Parameters

$name
$value

Return Value

void

at line 96
void addHeader($name, $value)

Adds HTTP header.

Parameters

$name
$value

Return Value

void

at line 104
void setContentType($type, $charset = NULL)

Sends a Content-type HTTP header.

Parameters

$type
$charset

Return Value

void

at line 112
void redirect($url, $code = self::S302_FOUND)

Redirects to a new URL.

Parameters

$url
$code

Return Value

void

at line 119
void setExpiration($seconds)

Sets the number of seconds before a page cached on a browser expires.

Parameters

$seconds

Return Value

void

at line 125
bool isSent()

Checks if headers have been sent.

Return Value

bool

at line 131
array getHeaders()

Returns a list of headers to sent.

Return Value

array

(name => value)

at line 144
void setCookie($name, $value, $expire, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL)

Sends a cookie.

Parameters

$name
$value
$expire
$path
$domain
$secure
$httpOnly

Return Value

void

at line 154
void deleteCookie($name, $path = NULL, $domain = NULL, $secure = NULL)

Deletes a cookie.

Parameters

$name
$path
$domain
$secure

Return Value

void