SS_HTTPResponse
class SS_HTTPResponse (View source)
Represents a response returned by a controller.
Methods
Create a new HTTP response
No description
The text to be given alongside the status code ("reason phrase").
No description
No description
Returns true if this HTTP response is in error
No description
No description
Add a HTTP header to the response, replacing any header of the same name.
Return the HTTP header of the given name.
No description
Remove an existing HTTP header by its name, e.g. "Content-Type".
No description
Send this HTTPReponse to the browser
Returns true if this response is "finished", that is, no more script execution should be done.
Details
__construct(string $body = null, int $statusCode = null, string $statusDescription = null)
Create a new HTTP response
$this
setStatusCode(int $code, string $description = null)
$this
setStatusDescription(string $description)
The text to be given alongside the status code ("reason phrase").
Caution: Will be overwritten by {@link setStatusCode()}.
int
getStatusCode()
string
getStatusDescription()
bool
isError()
Returns true if this HTTP response is in error
$this
setBody(string $body)
null|string
getBody()
$this
addHeader(string $header, string $value)
Add a HTTP header to the response, replacing any header of the same name.
getHeader(string $header, $anyCase = false)
Return the HTTP header of the given name.
array
getHeaders()
$this
removeHeader(string $header)
Remove an existing HTTP header by its name, e.g. "Content-Type".
$this
redirect(string $dest, int $code = 302)
output()
Send this HTTPReponse to the browser
bool
isFinished()
Returns true if this response is "finished", that is, no more script execution should be done.
Specifically, returns true if a redirect has already been requested