Add a header to the request. |
|
Add a parameter to the post. |
|
Execute the request method asynchronous using windows authentication. |
|
Execute the request method asynchronous. |
|
Execute the request method asynchronous. |
|
Execute the request method. |
|
Execute the request method. |
|
Execute a request method using windows authentication. |
|
Set the body of the request. |
|
Set the body of the request and content mime type. |
|
Set the charset used when posting. |
|
|
addFile(parameterName, jsFile) |
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample poster.addFile('myFileParamName','manual.doc','c:/temp/manual_01a.doc')
poster.addFile(null,'postXml.xml','c:/temp/postXml.xml') // sets the xml to post
var f = plugins.file.convertToJSFile('./somefile02.txt')
if (f && f.exists()) poster.addFile('myTxtFileParamName','somefile.txt', f)
f = plugins.file.convertToJSFile('./anotherfile_v2b.txt')
if (f && f.exists()) poster.addFile('myOtherTxtFileParamName', f) |
|
|
|
|
addFile(parameterName, fileName, jsFile) |
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample poster.addFile('myFileParamName','manual.doc','c:/temp/manual_01a.doc')
poster.addFile(null,'postXml.xml','c:/temp/postXml.xml') // sets the xml to post
var f = plugins.file.convertToJSFile('./somefile02.txt')
if (f && f.exists()) poster.addFile('myTxtFileParamName','somefile.txt', f)
f = plugins.file.convertToJSFile('./anotherfile_v2b.txt')
if (f && f.exists()) poster.addFile('myOtherTxtFileParamName', f) |
|
|
|
|
addFile(parameterName, fileName, fileLocation) |
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample poster.addFile('myFileParamName','manual.doc','c:/temp/manual_01a.doc')
poster.addFile(null,'postXml.xml','c:/temp/postXml.xml') // sets the xml to post
var f = plugins.file.convertToJSFile('./somefile02.txt')
if (f && f.exists()) poster.addFile('myTxtFileParamName','somefile.txt', f)
f = plugins.file.convertToJSFile('./anotherfile_v2b.txt')
if (f && f.exists()) poster.addFile('myOtherTxtFileParamName', f) |
|
|
|
|
addHeader(headerName, value) |
|
Add a header to the request. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample method.addHeader('Content-type','text/xml; charset=ISO-8859-1') |
|
|
|
|
addParameter(name, value) |
|
Add a parameter to the post. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample poster.addParameter('name','value')
poster.addParameter(null,'value') //sets the content to post |
|
|
|
|
executeAsyncRequest(username, password, workstation, domain, successCallbackMethod, errorCallbackMethod) |
|
Execute the request method asynchronous using windows authentication. Success callback method will be called when response is received. Response is sent as parameter in callback. If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter. |
|
|
Parameters The workstation the authentication request is originating from. |
|
The domain to authenticate within. |
|
callbackMethod to be called after response is received |
|
callbackMethod to be called if request errors out |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample method.executeAsyncRequest('username','password','mycomputername','domain',globals.successCallback,globals.errorCallback) |
|
|
|
|
executeAsyncRequest(username, password, successCallbackMethod, errorCallbackMethod) |
|
Execute the request method asynchronous. Success callback method will be called when response is received. Response is sent as parameter in callback. If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter. |
|
|
Parameters callbackMethod to be called after response is received |
|
callbackMethod to be called if request errors out |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample method.executeAsyncRequest(globals.successCallback,globals.errorCallback) |
|
|
|
|
executeAsyncRequest(successCallbackMethod, errorCallbackMethod) |
|
Execute the request method asynchronous. Success callback method will be called when response is received. Response is sent as parameter in callback. If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter. |
|
|
Parameters callbackMethod to be called after response is received |
|
callbackMethod to be called if request errors out |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample method.executeAsyncRequest(globals.successCallback,globals.errorCallback) |
|
|
|
|
Execute the request method. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var response = method.executeRequest()
To be able to reuse the client, the response must be
closed if the content is not read via getResponseBody
or getMediaData:
response.close() |
|
|
|
|
executeRequest(userName, password) |
|
Execute the request method. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var response = method.executeRequest()
To be able to reuse the client, the response must be
closed if the content is not read via getResponseBody
or getMediaData:
response.close() |
|
|
|
|
executeRequest(userName, password, workstation, domain) |
|
Execute a request method using windows authentication. |
|
|
Parameters The workstation the authentication request is originating from. |
|
The domain to authenticate within. |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var response = method.executeRequest('username','password','mycomputername','domain'); |
|
|
|
|
Set the body of the request. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample method.setBodyContent(content) |
|
|
|
|
setBodyContent(content, mimeType) |
|
Set the body of the request and content mime type. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample method.setBodyContent(content, 'text/xml') |
|
|
|
|
Set the charset used when posting. If this is null or not called it will use the default charset (UTF-8). |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var client = plugins.http.createNewHttpClient();
var poster = client.createPostRequest('https://twitter.com/statuses/update.json');
poster.addParameter('status',scopes.globals.textToPost);
poster.addParameter('source','Test Source');
poster.setCharset('UTF-8');
var httpCode = poster.executeRequest(scopes.globals.twitterUserName, scopes.globals.twitterPassword).getStatusCode() // httpCode 200 is ok |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample putRequest.setFile(jsFileInstance) |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample putRequest.setFile('c:/temp/manual_01a.doc') |
|
|
|
|
|
|