DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.



Method Summary
String
getCharset()
Get the charset of the response body.
byte[]
getMediaData()
Get the content of response as binary data.
String
getResponseBody()
Get the content of the response as String.
Object
getResponseHeaders()
Gets the headers of the response as name/value arrays.
Object
getResponseHeaders(headerName)
Gets the headers of the response as name/value arrays.
Number
getStatusCode()
Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.



Method Details

getCharset

String
getCharset
()
Get the charset of the response body.

Returns

String

Sample

var charset = response.getCharset();
 

getMediaData

byte[]
getMediaData
()
Get the content of response as binary data. It also supports gzip-ed content.

Returns

byte[]

Sample

var mediaData = response.getMediaData();
 

getResponseBody

String
getResponseBody
()
Get the content of the response as String.

Returns

String

Sample

var pageData = response.getResponseBody();
 

getResponseHeaders

Object
getResponseHeaders
()
Gets the headers of the response as name/value arrays.

Returns

Object

Sample

var allHeaders = response.getResponseHeaders();
var header;

for (header in allHeaders) application.output(header + ': ' + allHeaders[header]);
 

getResponseHeaders

Object
getResponseHeaders
(headerName)
Gets the headers of the response as name/value arrays.

Parameters

{String} headerName

Returns

Object

Sample

var contentLength = response.getResponseHeaders("Content-Length");
 

getStatusCode

Number
getStatusCode
()
Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.

Returns

Number

Sample

var status = response.getStatusCode();// compare with HTTP_STATUS constants