Description

: methods for HTTP responses. All the following examples assume that `response` is an instance of this class. ### Get header values Header names are case-insensitive, but normalized to Title-Case when the response is parsed. ``` val = response.getHeaderLine("content-type"); ``` Will read the Content-Type header. You can get all set headers using: ``` response.getHeaders(); ``` ### Get the response body You can access the response body stream using: ``` content = response.getBody(); ``` You can get the body string using: ``` content = response.getStringBody(); ``` If your response body is in XML or Json you can use special content type specific accessors to read the decoded data. Json data will be returned as arrays, while XML data will be returned as SimpleXML nodes: ``` Get as XML content = response.getXml() Get as Json content = response.getJson() ``` If the response cannot be decoded, null will be returned. ### Check the status code You can access the response status code using: ``` content = response.statusCode(); ```

Properties

Methods

InheritedAbstractFinalStaticDatatypeHeader
boolbool isOk()
ICookieCollectionICookieCollection buildCookieCollection()
SimpleXMLElementSimpleXMLElement getXml()
boolbool isRedirect()
CookieCollectionCookieCollection getCookieCollection()
this(string[]this(string[] unparsedHeaders = null, string responseBody = null)
Json[string]Json[string] getCookies()
JsonJson getJson()
stringstring getEncoding()
stringstring getStringBody()
voidvoid _parseHeaders(string[] headersToParse)
autoauto withStatus(int statusCode, string reasonPhrase = null)
Json[string]Json[string] getCookieData(string key)
Json[string]Json[string] _getCookies()
stringstring _getBody()
ISimpleXMLElementISimpleXMLElement _getXml()
string[]string[] getCookie(string aName)
JsonJson _getJson()
boolbool isSuccess()
stringstring _decodeGzipBody(string encodedBody)
STRINGAASTRINGAA _getHeaders()
stringstring getReasonPhrase()
intint statusCode()