Child pages
  • PostRequest

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Divcache
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)addFile(parameterName, jsFile)
styleindexdisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
id

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

Table Cell (td)
Boolean
Table Cell (td)addFile(parameterName, fileName, jsFile)
servoy sSummary12%30%58%height: 30px;3Methods SummaryAdd a file to the post. Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)addFile(parameterName, fileName, fileLocation)
Add a file to the post. Table Row (tr)Add a file to the post. Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)addHeader(headerName, value)
addParameter(name, value)
Add a header to the request. Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)Add a parameter to the post. Table Row (tr) Table Cell (td)void Table Cell (td)executeAsyncRequest(username, password, workstation, domain, successCallbackMethod, errorCallbackMethod)
Table Row (tr) Table Cell (td)Execute the request method asynchronous using windows authentication.void Table Cell (td)executeAsyncRequest(username, password, successCallbackMethod, errorCallbackMethod)
Table Row (tr) Table Cell (td)Execute the request method asynchronous.executeAsyncRequest(successCallbackMethod, errorCallbackMethod)
void Table Cell (td)Execute the request method asynchronous. Table Row (tr)
Table Cell (td)
Response
Table Cell (td)executeRequest()
Table Cell (td)
Response
Table Cell (td)executeRequest(userName, password)
Execute the request method. Table Row (tr)Execute the request method. Table Row (tr)
Table Cell (td)
Response
Table Cell (td)executeRequest(userName, password, workstation, domain)
Table Row (tr) Table Cell (td)Execute a request method using windows authentication. Table Cell (td)setBodyContent(content)
voidSet the body of the request. Table Row (tr) Table Cell (td)void Table Cell (td)setBodyContent(content, mimeType)
Table Row (tr) Table Cell (td)Set the body of the request and content mime type. Table Cell (td)setCharset(charset)
voidSet the charset used when posting. HTML Table

functionclass Colgroup Tag Colcolspanservoy sDetail2width100%

Col
Table Head (thead) Table Row (tr)styleheight:30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idaddFile-String_Object
Table Row (tr)
idname
Table Cell (td)

addFile

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addFile
Span2Methods DetailsaddFilename

addFile(parameterName, jsFile)

tr

iddes Table Cell (td) DivclassidsIndent
Add a file to the post.
Table Row (tr)tdprsclass

Parameters

Div Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addFile
SpansIndent{String} parameterName
{Object} jsFile
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddFile-String_String_Object
Table Row (tr)
idname
Table Cell (td)

addFile

parameterName ;jsFile ;ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addFilename

addFile(parameterName, fileName, jsFile)

tr

id Divclassdes Table Cell (td)sIndent
Add a file to the post.
Table Row (tr)idtd
prs

Parameters

Divclass Table Row (tr)
idret
td

sIndent{String} parameterName
{String} fileName
{Object} jsFileparameterName ;fileName ;jsFile ;ret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
Boolean Table Row (tr)
idsam
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddFile-String_String_String
Table Row (tr)
idname
Table Cell (td)

addFile

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addFile
SpanSmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
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)
idsIdentjavascriptlastDetailRowaddFilename

addFile(parameterName, fileName, fileLocation)

Table Row (tr)classdes Table Cell (td) DivsIndent
Add a file to the post.
Table Row (tr)idtd
prsclass

Parameters

Div Table Row (tr)
idret
tdsIndent{String} parameterName
{String} fileName
{String} fileLocationparameterName ;fileName ;fileLocation ;ret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
Boolean Table Row (tr)
idsam
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddHeader-String_String
Table Row (tr)
idname
Table Cell (td)

addHeader

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addHeader
SpanSmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
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)
sIdentjavascriptlastDetailRowaddHeadername

addHeader(headerName, value)

tr

idclassdes Table Cell (td) DivsIndent
Add a header to the request.
tr
idprs

Table Cell (td)class

Parameters

DivsIndent{String} headerName
{String} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
method.addHeader('Content-type','text/xml; charset=ISO-8859-1')
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddParameter-String_String
Table Row (tr)
idname
Table Cell (td)

addParameter

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
addParameter
Span
(name, value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add a parameter to the post.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} name
{String} value
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
poster.addParameter('name','value')
poster.addParameter(null,'value') //sets the content to post
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idexecuteAsyncRequest-String_String_String_String_Function_Function
Table Row (tr)
idname
Table Cell (td)

executeAsyncRequest

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
executeAsyncRequest
SpanidheaderName ;value ;ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addParametername

addParameter(name, value)

dessIndent
Add a parameter to the post.
prs

Parameters

sIndentname ;value ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

executeAsyncRequest(username, password, workstation, domain, successCallbackMethod, errorCallbackMethod)

Table Row (tr)classdes Table Cell (td) DivsIndent
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.
Table Row (tr)id
prs

Table Cell (td)

Parameters

div

classsIndent{String} username - the user name
{String} password - the password
{String} workstation - The workstation the authentication request is originating from.
{String} domain - The domain to authenticate within.
{Function} successCallbackMethod - callbackMethod to be called after response is received
{Function} errorCallbackMethod - Table Row (tr)

idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
executeAsyncRequest
SpancallbackMethod to be called if request errors outclients

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
method.executeAsyncRequest('username','password','mycomputername','domain',globals.successCallback,globals.errorCallback)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idexecuteAsyncRequest-String_String_Function_Function
Table Row (tr)
idname
Table Cell (td)

executeAsyncRequest

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

executeAsyncRequest(username, password, successCallbackMethod, errorCallbackMethod)

Table Row (tr)idclass

des Table Cell (td) DivsIndent
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.
Table Row (tr)idtd
prs

Parameters

Divclass

sIndent{String} username - the user name
{String} password - the password
{Function} successCallbackMethod - callbackMethod to be called after response is received
{Function} errorCallbackMethod - Table Body (tbody)

idexecuteAsyncRequest-Function_Function
Table Row (tr)
idname
Table Cell (td)

executeAsyncRequest

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
executeAsyncRequest
SpancallbackMethod to be called if request errors outclients

Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
method.executeAsyncRequest(globals.successCallback,globals.errorCallback)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
id

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

executeAsyncRequest(successCallbackMethod, errorCallbackMethod)

Table Row (tr)classdes Table Cell (td) DividsIndent
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.
Table Row (tr)tdprsclass

Parameters

DivsIndent{Function} successCallbackMethod - callbackMethod to be called after response is received
{Function} errorCallbackMethod -
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
method.executeAsyncRequest(globals.successCallback,globals.errorCallback)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idexecuteRequest
Table Row (tr)
idname
Table Cell (td)

executeRequest

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Response
Span
stylefont-weight: bold;
executeRequest
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Execute the request method.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Response
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var response = method.executeRequest()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idexecuteRequest-String_String
Table Row (tr)
idname
Table Cell (td)

executeRequest

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Response
Span
stylefont-weight: bold;
executeRequest
SpancallbackMethod to be called if request errors outidclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeRequestname

executeRequest()

dessIndent
Execute the request method.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeRequestname

executeRequest(userName, password)

Table Row (tr)classdes Table Cell (td) DivsIndent
Execute the request method.
tr
idprs

Table Cell (td)

Parameters

div

classsIndent{String} userName - the user name
{String} password - Table Row (tr)idthe passwordtdret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
Response Table Row (tr)
idsam
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idexecuteRequest-String_String_String_String
Table Row (tr)
idname
Table Cell (td)

executeRequest

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Response
Span
stylefont-weight: bold;
executeRequest
SpanSmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
var response = method.executeRequest()
idsIdentjavascriptlastDetailRowexecuteRequestname

executeRequest(userName, password, workstation, domain)

Table Row (tr)classdes Table Cell (td) DivsIndent
Execute a request method using windows authentication.
Table Row (tr)idtd
prs

Parameters

div

classsIndent{String} userName - the user name
{String} password - the password
{String} workstation - The workstation the authentication request is originating from.
{String} domain - Table Row (tr)idThe domain to authenticate within.ret

Table Cell (td)

Returns

divsIndentclients

classid

Supported Clients

sIndent
Response Table Row (tr)SmartClient,WebClient,NGClientsam

Table Cell (td)

Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetBodyContent-String
Table Row (tr)
idname
Table Cell (td)

setBodyContent

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setBodyContent
Span
(content)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the body of the request.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} content
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
method.setBodyContent(content)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetBodyContent-String_String
Table Row (tr)
idname
Table Cell (td)

setBodyContent

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setBodyContent
Span
(content, mimeType)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the body of the request and content mime type.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} content
{String} mimeType
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
method.setBodyContent(content, 'text/xml')
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsetCharset-
Table Row (tr)
idname
Table Cell (td)

setCharset

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setCharset
Span
(charset)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the charset used when posting. If this is null or not called it will use the default charset (UTF-8).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
charset
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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
Table Row (tr)
classlastDetailRow
Table Cell (td) 

Sample

Div
classsIndent
Code Block
languagejavascript
var response = method.executeRequest('username','password','mycomputername','domain');
sIdentjavascriptlastDetailRowsetBodyContentname

setBodyContent(content)

dessIndent
Set the body of the request.
prs

Parameters

sIndentcontent ;
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setBodyContentname

setBodyContent(content, mimeType)

dessIndent
Set the body of the request and content mime type.
prs

Parameters

sIndentcontent ;mimeType ;
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setCharsetname

setCharset(charset)

dessIndent
Set the charset used when posting. If this is null or not called it will use the default charset (UTF-8).
prs

Parameters

sIndentcharset ;
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow