Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
id | createHttpClient |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createHttpClient |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| createHttpClient |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Create a named http client (like a web browser with session binding) usable todo multiple request/posts in same server session. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters http_clientname |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
plugins.http.createHttpClient('mybrowser');
var pageData = plugins.http.getPageData('http://www.cnn.com','mybrowser','username','mypassword');
|
|
|
|
|
Table Body (tbody) |
---|
id | deleteHttpClient |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
deleteHttpClient |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| deleteHttpClient |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Delete a named http client. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters http_clientname |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
plugins.http.deleteHttpClient('mybrowser');
|
|
|
|
|
Table Body (tbody) |
---|
id | getHttpClientCookie |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getHttpClientCookie |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Cookie |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getHttpClientCookie |
Span |
---|
| (clientName, cookieName) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get cookie object from the specified client. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters clientName cookieName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var cookie = plugins.http.getHttpClientCookie('clientName', 'JSESSIONID');
if (cookie != null)
{
// do something
}
else
plugins.http.setHttpClientCookie('clientName', 'JSESSIONID', 'abc', 'localhost', '/', -1, false)
|
|
|
|
|
Table Body (tbody) |
---|
id | getHttpClientCookies |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getHttpClientCookies |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Cookie[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getHttpClientCookies |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns a Cookie array with all the cookies set on the specified client. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters clientName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Cookie[] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var cookies = plugins.http.getHttpClientCookies('clientName')
|
|
|
|
|
Table Body (tbody) |
---|
id | getLastPageCharset |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getLastPageCharset |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getLastPageCharset |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the charset of the last page received with getPageData(...) |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var a = plugins.http.getPageData('http://www.google.com.hk');
var charset = plugins.http.getLastPageCharset();
var success = plugins.file.writeTXTFile('someFilePath', a, charset);
if (!success) plugins.dialogs.showWarningDialog('Warning', 'Could not write file', 'OK');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| byte[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getMediaData |
Span |
---|
| (url, [http_clientname]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get media (binary data) such as images in a variable. It also supports gzip-ed content. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters url [http_clientname] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns byte[] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var image_byte_array = plugins.http.getMediaData('http://www.cnn.com/cnn.gif');
var image_byte_array2 = plugins.http.getMediaData('http://www.cnn.com/cnn.gif', 'clientName');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getPageData |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getPageData |
Span |
---|
| (url, [http_clientname], [username], [password]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get all page html in a variable (authentication only works with http client usage). If name is provided a http client will be created/used. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters url [http_clientname] [username] [password] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
// get data using a default connection
var pageData = plugins.http.getPageData('http://www.cnn.com');
// create an http client and use it to get the data
var pageData = plugins.http.getPageData('http://www.cnn.com','myclient');
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Poster |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getPoster |
Span |
---|
| (url, [http_clientname]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get poster object to do http (file) posts. If posting files, it will post multipart! |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters url [http_clientname] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var poster = plugins.http.getPoster('http://www.abc.com/apply_form.jsp');
var didAddParam = poster.addParameter('myParamName','myValue');
var didAddFile = poster.addFile('myFileParamName','manual.doc','c:/temp/manual_01a.doc');
var httpCode = poster.doPost('username','mypassword'); //httpCode 200 is ok
//var httpCode = poster.doPost('username','mypassword'); //use if authentication is needed
var pageData = poster.getPageData()
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| put |
Span |
---|
| (clientName, url, fileName, filePath, [username], [password]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Put a file at the specified URL. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters clientName url fileName filePath [username] [password] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var fileAdded = plugins.http.put('clientName', 'http://www.abc.com/put_stuff.jsp', 'manual.doc', 'c:/temp/manual_01a.doc', 'user', 'password')
|
|
|
|
|
Table Body (tbody) |
---|
id | setClientProxyUserNamePassword |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setClientProxyUserNamePassword |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setClientProxyUserNamePassword |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Set the proxy username and password. Used for named http clients ( else use implicit java data). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters username password |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
plugins.http.setClientProxyUserNamePassword('my_proxy_username','my_proxy_password');
|
|
|
|
|
Table Body (tbody) |
---|
id | setHttpClientCookie |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setHttpClientCookie |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| setHttpClientCookie |
Span |
---|
| (clientName, cookieName, cookieValue, [domain], [path], [maxAge], [secure]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Add cookie to the specified client. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters clientName cookieName cookieValue [domain] [path] [maxAge] [secure] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var cookieSet = plugins.http.setHttpClientCookie('clientName', 'JSESSIONID', 'abc', 'localhost', '/', -1, false)
if (cookieSet)
{
//do something
}
|
|
|
|
|
|