RestfulService_Response
class RestfulService_Response extends SS_HTTPResponse (View source)
Properties
protected static | array | $status_codes | from SS_HTTPResponse | |
protected static | array | $redirect_codes | from SS_HTTPResponse | |
protected | int | $statusCode | from SS_HTTPResponse | |
protected | string | $statusDescription | from SS_HTTPResponse | |
protected | array | $headers | HTTP Headers like "Content-Type: text/xml" |
from SS_HTTPResponse |
protected | string | $body | from SS_HTTPResponse | |
protected | $simpleXML | |||
protected | RestfulService_Response|false | $cachedResponse |
Methods
No description
The text to be given alongside the status code ("reason phrase").
Add a HTTP header to the response, replacing any header of the same name.
Return the HTTP header of the given name.
Remove an existing HTTP header by its name, e.g. "Content-Type".
Returns true if this response is "finished", that is, no more script execution should be done.
get the cached response object. This allows you to access the cached eaders, not just the cached body.
Details
__construct(string $body, int $statusCode = 200, $headers = null)
Create a new HTTP response
$this
setStatusCode(int $code, string $description = null)
No description
$this
setStatusDescription(string $description)
The text to be given alongside the status code ("reason phrase").
Caution: Will be overwritten by setStatusCode().
int
getStatusCode()
No description
string
getStatusDescription()
No description
bool
isError()
Returns true if this HTTP response is in error
$this
setBody(string $body)
No description
null|string
getBody()
No description
$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()
No description
$this
removeHeader(string $header)
Remove an existing HTTP header by its name, e.g. "Content-Type".
$this
redirect(string $dest, int $code = 302)
No description
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
simpleXML()
No description
RestfulService_Response|false
getCachedResponse()
get the cached response object. This allows you to access the cached eaders, not just the cached body.
string|false
getCachedBody()
No description
setCachedBody($content)
deprecated
deprecated
No description
setCachedResponse($response)
No description
xpath($xpath)
Return an array of xpath matches
xpath_one($xpath)
Return the first xpath match