Returns Supported Clients Sample Parameters Returns Supported Clients Sample Returns Supported Clients Sample Parameters Returns Supported Clients Sample Parameters Returns Supported Clients Sample
Nov 25, 2023 23:04
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
.
HttpClient
createNewHttpClient(config)
Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.
HttpClientConfig
createNewHttpClientConfig()
Create a http client config
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
.
WARNING: Make sure you call client.close() on it after you used this client object to clean up resources.
Starting a HTTPClient is the same as starting an actual browser without UI!
var client = plugins.http.createNewHttpClient();
createNewHttpClient(config)
Create an http client (like a web browser with session binding) usable todo multiple request/posts in same server session.
WARNING: Make sure you call client.close() on it after you used this client object to clean up resources.
Starting a HTTPClient is the same as starting an actual browser without UI!
HttpClientConfig
config
httpclient config
var client = plugins.http.createNewHttpClient(config);
createNewHttpClientConfig()
Create a http client config
var config = plugins.http.createNewHttpClientConfig();
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)
String
url
;
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)
String
url
;
// get data using a default connection
var pageData = plugins.http.getPageData('http://www.cnn.com');
1 Comment
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')