Child pages
  • PutRequest

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryAdd a file to the post.Add a file to the post; it will try to get the correct mime type from the file name or the first bytes.Add a file to the post .Add a header to the request.Add a parameter to the post.voidExecute the request method asynchronous using windows authentication.voidExecute the request method asynchronous using windows authentication.voidExecute the request method asynchronous.voidExecutes the request method asynchronous.voidExecute the request method asynchronous.voidExecutes the request method asynchronous.Execute the request method.Execute the request method.Execute a request method using windows authentication.voidSet the body of the request.voidSet the body of the request and content mime type.voidSet the charset used when posting.Set a file to put.Set a file to put.voidWhatever to use preemptive authentication (sending the credentials in the header, avoiding the server request to the client - useful when uploading files, as some http servers would cancel the first request from the client, if too big, as the authentication request to the client was not yet sent)

functionservoy sDetail2100%height:30px2Methods DetailsaddFilename

addFile(parameterName, jsFile)

dessIndent
Add a file to the post.
prs

Parameters

sIndentparameterName ;jsFile ;ret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowaddFilename

addFile(parameterName, fileName, jsFile)

dessIndent
Add a file to the post.
prs

Parameters

sIndentparameterName ;fileName ;jsFile ;ret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowaddFilename

addFile(parameterName, fileName, fileLocation)

dessIndent
Add a file to the post.
prs

Parameters

sIndentparameterName ;fileName ;fileLocation ;ret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowaddHeadername

addHeader(headerName, value)

dessIndent
Add a header to the request.
prs

Parameters

sIndentheaderName ;value ;ret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowaddParametername

addParameter(name, value)

dessIndent
Add a parameter to the post.
prs

Parameters

sIndentname ;value ;ret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowexecuteAsyncRequestname

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

dessIndentExecute the request method asynchronous using windows authentication. Success callback method will be called when response is received. Response is sent as parameter in callbackwith a given mime type; could also be used to force the default 'application/octet-stream' on it, because this plugin will try to guess the correct mime type for the given file otherwise (based on the name or the bytes).Add a file to the post; it will try to get the correct mime type from the file name or the first bytes.Add a file to the post with a given mime type; could also be used to force the default 'application/octet-stream' on it, because this plugin will try to guess the correct mime type for the given file otherwise (based on the name or the bytes).Add a file to the post; it will try to get the correct mime type from the file name or the first bytes.Add a file to the post with a given mime type; could also be used to force the default 'application/octet-stream' on it, because this plugin will try to guess the correct mime type for the given file otherwise (based on the name or the bytes).Add a header to the request.Add a parameter to the post.voidExecute the request method asynchronous.voidExecute the request method asynchronous using windows authentication.voidExecute the request method asynchronous.voidExecute the request method asynchronous using windows authentication.voidExecute the request method asynchronous.voidExecute the request method asynchronous using windows authentication.Execute the request method.Execute the request method.Execute a request method using windows authentication.voidForce this request to prepare a "Content-Type: multipart/form-data" formatted message even if only one file or only a number of parameter were added to it.voidSet the body of the request.voidSet the body of the request and content mime type.voidSet the charset used when posting.Set a file to put.Set a file to put.voidWhatever to use preemptive authentication (sending the credentials in the header, avoiding the server request to the client - useful when uploading files, as some http servers would cancel the first request from the client, if too big, as the authentication request to the client was not yet sent)

functionservoy sDetail2100%height:30px2Methods DetailsaddFilename

addFile(parameterName, jsFile)

dessIndent
Add a file to the post; it will try to get the correct mime type from the file name or the first bytes.

If you add a single file then this will be a single file (so not a multi-part) post. If you want/need multi-part
then you have to either add multiple files or both a file and one or more parameters using addParameter(...).
prs

Parameters

sIndentparameterName ;jsFile ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowaddFilename

addFile(parameterName, jsFile, mimeType)

dessIndent
Add a file to the post with a given mime type; could also be used to force the default 'application/octet-stream' on it,
because this plugin will try to guess the correct mime type for the given file otherwise (based on the name or the bytes).

If you add a single file then this will be a single file (so not a multi-part) post. If you want/need multi-part
then you have to either add multiple files or both a file and one or more parameters using addParameter(...).
prs

Parameters

sIndentparameterName ;jsFile ;mimeTypeThe mime type that must be used could be the real default ('application/octet-stream') if the files one (by name or by its first bytes) is not good.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addFilename

addFile(parameterName, fileName, jsFile)

dessIndent
Add a file to the post; it will try to get the correct mime type from the file name or the first bytes.

If you add a single file then this will be a single file (so not a multi-part) post. If you want/need multi-part
then you have to either add multiple files or both a file and one or more parameters using addParameter(...).
prs

Parameters

sIndentparameterName ;fileName ;jsFile ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addFilename

addFile(parameterName, fileName, jsFile, mimeType)

dessIndent
Add a file to the post with a given mime type; could also be used to force the default 'application/octet-stream' on it,
because this plugin will try to guess the correct mime type for the given file otherwise (based on the name or the bytes).

If you add a single file then this will be a single file (so not a multi-part) post. If you want/need multi-part
then you have to either add multiple files or both a file and one or more parameters using addParameter(...).
prs

Parameters

sIndentparameterName ;fileName ;jsFile ;mimeTypeThe mime type that must be used could be the real default ('application/octet-stream') if the files one (by name or by its first bytes) is not good.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addFilename

addFile(parameterName, fileName, fileLocation)

dessIndent
Add a file to the post; it will try to get the correct mime type from the file name or the first bytes.

If you add a single file then this will be a single file (so not a multi-part) post. If you want/need multi-part
then you have to either add multiple files or a file and at least a parameter via addParameter(...).
prs

Parameters

sIndentparameterName ;fileName ;fileLocation ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addFilename

addFile(parameterName, fileName, fileLocation, mimeType)

dessIndent
Add a file to the post with a given mime type; could also be used to force the default 'application/octet-stream' on it,
because this plugin will try to guess the correct mime type for the given file otherwise (based on the name or the bytes).

If you add a single file then this will be a single file (so not a multi-part) post. If you want/need multi-part
then you have to either add multiple files or both a file and one or more parameters using addParameter(...).
prs

Parameters

sIndentparameterName ;fileName ;fileLocation ;mimeTypeThe mime type that must be used could be the real default ('application/octet-stream') if the files one (by name or by its first bytes) is not good.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addHeadername

addHeader(headerName, value)

dessIndent
Add a header to the request.
prs

Parameters

sIndentheaderName ;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.

If there is also at least one file added to this request using addFile(...) then a multi-part post will be generated.
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)

dessIndent
Execute the request method asynchronous. Success callback method will be called when response is received.
Response is sent as parameter in callback.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback.
So you need to test the Reponse.getStatusCode() for that to know if everything did go OK.
If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter.
prs

Parameters

sIndentusernamethe user namepasswordthe passwordworkstationThe workstation the authentication request is originating from.domainThe domain to authenticate within.successCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors out
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

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

dessIndent
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 followed by any 'callbackExtraArgs' that were given.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback.
So you need to test the Reponse.getStatusCode() for that to know if everything did go OK.
If no response is received (request errors out, network errors), the errorCallbackMethod is called with exception message as parameter followed by any 'callbackExtraArgs' that were given.
prs

Parameters

sIndentusernamethe user namepasswordthe passwordworkstationThe workstation the authentication request is originating from.domainThe domain to authenticate within.successCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors outcallbackExtraArgsextra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

executeAsyncRequest(username, password, successCallbackMethod, errorCallbackMethod)

dessIndent
Execute the request method asynchronous. Success callback method will be called when response is received.
Response is sent as parameter in callback.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback.
So you need to test the Reponse.getStatusCode() for that to know if everything did go OK.
If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter.
prs

Parameters

sIndentusernamethe user namepasswordthe passwordsuccessCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors out
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

executeAsyncRequest(username, password, successCallbackMethod, errorCallbackMethod, callbackExtraArgs)

dessIndent
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 followed by any 'callbackExtraArgs' that were given.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback.
So you need to test the Reponse.getStatusCode() for that to know if everything did go OK.
If no response is received (request errors out, network errors), the errorCallbackMethod is called with exception message as parameter followed by any 'callbackExtraArgs' that were given.
prs

Parameters

sIndentusernamethe user namepasswordthe password
workstationThe workstation the authentication request is originating from.domainThe domain to authenticate within.successCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors outrequest errors outcallbackExtraArgsextra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

executeAsyncRequest(

username, password, workstation, domain,

successCallbackMethod, errorCallbackMethod

, callbackExtraArgs

)

dessIndent
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 followed by any 'callbackExtraArgs' that were given
 as parameter in callback.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback.
So you need to test the Reponse.getStatusCode() for that to know if everything did go OK.
If no response is received (request errors out
, network errors
), the errorCallbackMethod is called with exception message as
parameter followed by any 'callbackExtraArgs' that were given.prs

Parameters

sIndentusernamethe user namepasswordthe passwordworkstationThe workstation the authentication request is originating from.domainThe domain to authenticate within.successCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors outcallbackExtraArgsextra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)
 parameter.
prs

Parameters

sIndentsuccessCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors out
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestname

executeAsyncRequest(

username, password,

successCallbackMethod, errorCallbackMethod, callbackExtraArgs)

dessIndent
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
followed 
no
by 
response is received (request errors out), the errorCallbackMethod is called with exception message as parameter.prs

Parameters

sIndentusernamethe user namepasswordthe passwordsuccessCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors outclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowexecuteAsyncRequestname

executeAsyncRequest(username, password, successCallbackMethod, errorCallbackMethod, callbackExtraArgs)

dessIndentExecutes the request method asynchronous. Success callback method will be called when response is received. Response is sent as parameter in callback followed by any 'callbackExtraArgs' that were givenpasswordthe password
any 'callbackExtraArgs' that were given.
This Response can be a response with a different status code then just 200, it could also be 500, which is still a valid response from the server, this won't go into the error callback.
So you need to test the Reponse.getStatusCode() for that to know if everything did go OK.
If no response is received (request errors out, network errors), the errorCallbackMethod is called with exception message as parameter followed by any 'callbackExtraArgs' that were given.
prs

Parameters

sIndent
usernamethe user namesuccessCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors outcallbackExtraArgsextra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)or array/objects of primitive types)clients

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
executeAsyncRequestexecuteRequestname

executeAsyncRequest

executeRequest(

successCallbackMethod

userName,

errorCallbackMethod

password)

dessIndent
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.prs

Parameters

sIndentsuccessCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors out
 the request method.
prs

Parameters

sIndentuserNamethe user namepasswordthe password
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeRequestname

executeRequest(userName, password, workstation, domain)

dessIndent
Execute a request method using windows authentication.
prs

Parameters

sIndentuserNamethe user namepasswordthe passwordworkstationThe workstation the authentication request is originating from.domainThe domain to authenticate within.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeAsyncRequestforceMultipartname

executeAsyncRequest(successCallbackMethod, errorCallbackMethod, callbackExtraArgs)dessIndent
Executes the request method asynchronous.
Success callback method will be called when response is received. Response is sent as parameter in callback followed by any 'callbackExtraArgs' that were given.
If no response is received (request errors out), the errorCallbackMethod is called with exception message as parameter followed by any 'callbackExtraArgs' that were given.
prs

Parameters

sIndentsuccessCallbackMethodcallbackMethod to be called after response is receivederrorCallbackMethodcallbackMethod to be called if request errors outcallbackExtraArgsextra arguments that will be passed to the callback methods; can be used to identify from which request the response arrived when using the same callback method for multiple requests. Please use only simple JSON arguments (primitive types or array/objects of primitive types)clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowexecuteRequestname

executeRequest()

dessIndent
Execute the request method.
ret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowexecuteRequestname

executeRequest(userName, password)

dessIndent
Execute the request method.
prs

Parameters

sIndentuserNamethe user namepasswordthe passwordret

Returns

sIndentclients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascriptlastDetailRowexecuteRequestname

executeRequest(userName, password, workstation, domain)

dessIndent
Execute a request method using windows authentication.
prs

Parameters

sIndentuserNamethe user namepasswordthe passwordworkstationThe workstation the authentication request is originating from.domainThe domain to authenticate within.ret

Returns

sIndent

forceMultipart(forceMultipart)

dessIndent
Force this request to prepare a "Content-Type: multipart/form-data" formatted message
even if only one file or only a number of parameter were added to it.

It is useful because some servers require this (they only support multipart - even if you don't need to send multiple things).
Before Servoy 2021.03 you could force it to send multipart by adding a dummy parameter together with a single file (or the other way around) - if the server didn't object to that dummy content...

Default value: false. (if you only add one file or only parameters it will not generate a multipart request)
prs

Parameters

sIndentforceMultipartif true, this request will send a multipart/form-data message even if you only add one file or only parameters. If false (default) it will send multipart only in case of multiple files or one file plus at least one parameter.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setBodyContentname

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
setFilename

setFile(file)

dessIndent
Set a file to put.
prs

Parameters

sIndentfile ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setFilename

setFile(filePath)

dessIndent
Set a file to put.
prs

Parameters

sIndentfilePath ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
usePreemptiveAuthenticationname

usePreemptiveAuthentication(b)

dessIndent
Whatever to use preemptive authentication (sending the credentials in the header, avoiding the server request to
the client - useful when uploading files, as some http servers would cancel the first request from the client, if too big,
as the authentication request to the client was not yet sent)
prs

Parameters

sIndentb ;
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow