Skip to end of metadata
Go to start of metadata

Refresh page Jun 19, 2019 18:39

Supported Clients
SmartClient WebClient NGClient

Methods Summary
HttpClient createNewHttpClient() Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.
Array getMediaData(url) Get media (binary data) such as images in a variable.
String getPageData(url) Get all page html in a variable, if this url is an https url that uses certificates unknown to Java then you have to use the HttpClient so that smart client users will get the unknown certificate dialog that they then can accept or you must make sure that those server certificates are stored in the cacerts of the java vm that is used (this is required for a web or headless client)

Methods Details

createNewHttpClient()

Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var client = plugins.http.createNewHttpClient();

getMediaData(url)

Get media (binary data) such as images in a variable. It also supports gzip-ed content.
If this url is an https url that uses certificates unknown to Java
then you have to use the HttpClient so that smart client users will get the unknown certificate dialog that they then can accept
or you must make sure that those server certificates are stored in the cacerts of the java vm that is used (this is required for a web or headless client)

Parameters

String url ;

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var image_byte_array = plugins.http.getMediaData('http://www.cnn.com/cnn.gif');

getPageData(url)

Get all page html in a variable, if this url is an https url that uses certificates unknown to Java
then you have to use the HttpClient so that smart client users will get the unknown certificate dialog that they then can accept
or you must make sure that those server certificates are stored in the cacerts of the java vm that is used (this is required for a web or headless client)

Parameters

String url ;

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

// get data using a default connection
var pageData = plugins.http.getPageData('http://www.cnn.com');

  • No labels

1 Comment

  1. Anonymous

    no info about the setting: setTimeout //Sets a timeout in milliseconds for retrieving of data (when 0 there is no timeout).
    plugins.http.setTimeout(1000,'client_name')
    //Sets a timeout in milliseconds for retrieving of data (when 0 there is no timeout).

    plugins.http.setTimeout(1000,'client_name')