Child pages
  • Response
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Refresh page Apr 29, 2024 21:58

Supported Clients
SmartClient WebClient NGClient

Methods Summary
Boolean close() Needs to be called when not reading content via getResponseBody or getMediaData to be able to reuse the client.
String getCharset() Get the charset of the response body.
Array 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.

Methods Details

close()

Needs to be called when not reading content via getResponseBody or getMediaData
to be able to reuse the client.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getCharset()

Get the charset of the response body.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var charset = response.getCharset();

getMediaData()

Get the content of response as binary data. It also supports gzip-ed content.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var mediaData = response.getMediaData();

getResponseBody()

Get the content of the response as String.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var pageData = response.getResponseBody();

getResponseHeaders()

Gets the headers of the response as name/value arrays.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

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

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

getResponseHeaders(headerName)

Gets the headers of the response as name/value arrays.

Parameters

String headerName ;

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

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

getStatusCode()

Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

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

  • No labels