86 100 =>
'100 Continue',
87 101 =>
'101 Switching Protocols',
91 202 =>
'202 Accepted',
92 203 =>
'203 Non-Authoritative Information',
93 204 =>
'204 No Content',
94 205 =>
'205 Reset Content',
95 206 =>
'206 Partial Content',
97 300 =>
'300 Multiple Choices',
98 301 =>
'301 Moved Permanently',
100 303 =>
'303 See Other',
101 304 =>
'304 Not Modified',
102 305 =>
'305 Use Proxy',
103 306 =>
'306 (Unused)',
104 307 =>
'307 Temporary Redirect',
106 400 =>
'400 Bad Request',
107 401 =>
'401 Unauthorized',
108 402 =>
'402 Payment Required',
109 403 =>
'403 Forbidden',
110 404 =>
'404 Not Found',
111 405 =>
'405 Method Not Allowed',
112 406 =>
'406 Not Acceptable',
113 407 =>
'407 Proxy Authentication Required',
114 408 =>
'408 Request Timeout',
115 409 =>
'409 Conflict',
117 411 =>
'411 Length Required',
118 412 =>
'412 Precondition Failed',
119 413 =>
'413 Request Entity Too Large',
120 414 =>
'414 Request-URI Too Long',
121 415 =>
'415 Unsupported Media Type',
122 416 =>
'416 Requested Range Not Satisfiable',
123 417 =>
'417 Expectation Failed',
124 422 =>
'422 Unprocessable Entity',
127 500 =>
'500 Internal Server Error',
128 501 =>
'501 Not Implemented',
129 502 =>
'502 Bad Gateway',
130 503 =>
'503 Service Unavailable',
131 504 =>
'504 Gateway Timeout',
132 505 =>
'505 HTTP Version Not Supported' 144 $this->request = $req;
145 $this->
header(
'Content-Type',
'text/html');
196 public function header( $key, $value = null ) {
197 if ( !is_null($value) ) {
209 if ( !is_null(
$body) ) {
224 $this->length += strlen(
$body);
226 $this->
header(
'Content-Length', $this->length);
254 unset($this->
headers[
'Content-Type']);
271 return ( $this->status < 100 || $this->
status >= 200 ) && $this->
status != 204 && $this->
status != 304;
282 if ( substr(PHP_SAPI, 0, 3) ===
'cgi') {
284 header(
'Status: ' . self::getMessageForCode($this->
status()));
291 foreach ( $this->
headers() as $name => $value ) {
296 foreach ( $this->
getCookieJar()->getResponseCookies() as $name => $cookie ) {
298 if ( version_compare(PHP_VERSION,
'5.2.0',
'>=') ) {
299 setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpires(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), $cookie->getHttpOnly());
301 setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpires(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure());
318 if ( !headers_sent() ) {
321 if ( $this->
canHaveBody() && $this->request->isHead() === false ) {
static getMessageForCode( $status)
Get message for HTTP status code.
status( $status=null)
Set and/or get the HTTP response status code.
getCookieJar()
Get cookie jar.
write( $body)
Append the HTTP response body.
httpVersion( $version=null)
Set and/or get the HTTP response version.
canHaveBody()
Can this HTTP response have a body?
Add rich text string
The name of the decorator.
body( $body=null)
Set the HTTP response body.
header( $key, $value=null)
Get and/or set an HTTP response header.
sendHeaders()
Send headers for HTTP response.
finalize()
Finalize response headers before response is sent.
Create styles array
The data for the language used.
__construct(Slim_Http_Request $req)
Constructor.
headers()
Get HTTP response headers.
setCookieJar(Slim_Http_CookieJar $cookieJar)
Set cookie jar.
send()
Send HTTP response.
Slim - a micro PHP 5 framework.