Last updated
Was this helpful?
Last updated
Was this helpful?
A wrapper for Apache HttpClient
for executing requests like GET, POST, PUT, and more, with support for cookies, proxies, and timeouts.
The client facilitates various HTTP requests (e.g., GET, POST, DELETE) and supports configuration options like cookies, proxy servers, and timeouts. It enables both synchronous and asynchronous communication, offering flexibility for different use cases.
For configuration details, see the section.
releases all resources that this client has, should be called after usage.
Returns: void
Creates a new delete request (a request to delete a resource on server).
Parameters
Sample
Creates a new get request (retrieves whatever information is stored on specified url). If this url is a https ssl encrypted url which certificates are not in the java certificate store. (Like a self signed certificate or a none existing root certificate) Then for a smart client a dialog will be given, to give the user the ability to accept this certificate for the next time. For a Web or Headless client the system administrator does have to add that certificate (chain) to the java install on the server. See https://wiki.servoy.com/display/tutorials/Import+a+%28Root%29+certificate+in+the+java+cacerts+file
Parameters
Sample
Creates a new head request (similar to get request, must not contain body content).
Parameters
Sample
Creates a new options request (a request for information about communication options).
Parameters
Sample
Creates a new patch request (used for granular updates).
Parameters
Sample
Create a new post request ( Origin server should accept/process the submitted data.) If this url is a https ssl encrypted url which certificates are not in the java certificate store. (Like a self signed certificate or a none existing root certificate) Then for a smart client a dialog will be given, to give the user the ability to accept this certificate for the next time. For a Web or Headless client the system administrator does have to add that certificate (chain) to the java install on the server. See https://wiki.servoy.com/display/tutorials/Import+a+%28Root%29+certificate+in+the+java+cacerts+file
Parameters
Sample
Creates a new put request (similar to post request, contains information to be submitted).
Parameters
Sample
Creates a new trace request (debug request, server will just echo back).
Parameters
Sample
Execute multiple requests asynchronously. A Promise is returned that resolves with an array of Response objects when all requests are complete in the same order as the Request objects. Because some request can fail and others can just work, this promise will always just resolve (not reject) with response object having the message of the error or the actual normal response.
Parameters
Sample
Execute multiple requests asynchronously, it assumes that all request are to the same server (it gives the same username, password to all requests).
A Promise is returned that resolves with an array of Response objects when all requests are complete in the same order as the Request objects. Because some request can fail and others can just work, this promise will always just resolve (not reject) with response object having the message of the error or the actual normal response.
Parameters
Sample
Execute multiple requests asynchronously, it assumes that all request are to the same server (it gives the same username, password, workstation and domain to all requests).
A Promise is returned that resolves with an array of Response objects when all requests are complete in the same order as the Request objects. Because some request can fail and others can just work, this promise will always just resolve (not reject) with response object having the message of the error or the actual normal response.
BaseRequest[] request
Parameters
Get a cookie by name.
Parameters
Sample
Get all cookies from this client.
Sample
Set proxy credentials.
Parameters
Returns: void
Sample
Set proxy server.
Parameters
Returns: void
Sample
Add cookie to the this client.
Parameters
Sample
Add cookie to the this client.
Parameters
Sample
Add cookie to the this client.
Parameters
Sample
Add cookie to the this client.
Parameters
Sample
Add cookie to the this client.
Parameters
Sample
Sets a timeout in milliseconds for retrieving of data (when 0 there is no timeout).
Parameters
Returns: void
Sample
url ;
Returns: a DeleteRequest object for creating a DELETE request to the specified URL.
url ;
Returns: a GetRequest object for creating a GET request to the specified URL.
url ;
Returns: a HeadRequest object for creating a HEAD request to the specified URL.
url ;
Returns: an OptionsRequest object for creating an OPTIONS request to the specified URL.
url ;
Returns: a PatchRequest object for creating a PATCH request to the specified URL.
url ;
Returns: a PostRequest object for creating a POST request to the specified URL.
url ;
Returns: a PutRequest object for creating a PUT request to the specified URL.
url ;
Returns: a TraceRequest object for creating a TRACE request to the specified URL.
requests ;
Returns: The promise object that resolves with an array of Response objects when all requests are complete in the same order as the Request objects.
requests ;
username the user name
password the password
Returns: The promise object that resolves with an array of Response objects when all requests are complete in the same order as the Request objects.
requests ;
username the user name
password the password
workstation The workstation the authentication request is originating from.
domain The domain to authenticate within.
Returns: The promise object that resolves with an array of Response objects when all requests are complete in the same order as the Request objects.
cookieName ;
Returns: the cookie with the specified name, or null if it does not exist.
Returns: an array of all cookies currently stored in the client.
userName ;
password ;
hostname - proxy host // null value will clear proxyHost settings;
port - proxy port //null value will clear proxyHost settings;
cookieName the name of the cookie
cookieValue the value of the cookie
Returns: true if the cookie was successfully set; otherwise, false.
cookieName the name of the cookie
cookieValue the value of the cookie
domain the domain
Returns: true if the cookie was successfully set; otherwise, false.
cookieName the name of the cookie
cookieValue the value of the cookie
domain the domain
path the path
Returns: true if the cookie was successfully set; otherwise, false.
cookieName the name of the cookie
cookieValue the value of the cookie
domain the domain
path the path
maxAge maximum age of cookie
Returns: true if the cookie was successfully set; otherwise, false.
cookieName the name of the cookie
cookieValue the value of the cookie
domain the domain
path the path
maxAge maximum age of cookie
secure true if it is a secure cookie, false otherwise
Returns: true if the cookie was successfully set; otherwise, false.
msTimeout ;
void
releases all resources that this client has, should be called after usage.
Creates a new delete request (a request to delete a resource on server).
Creates a new get request (retrieves whatever information is stored on specified url).
Creates a new head request (similar to get request, must not contain body content).
Creates a new options request (a request for information about communication options).
Creates a new patch request (used for granular updates).
Create a new post request ( Origin server should accept/process the submitted data.
Creates a new put request (similar to post request, contains information to be submitted).
Creates a new trace request (debug request, server will just echo back).
Execute multiple requests asynchronously.
Execute multiple requests asynchronously, it assumes that all request are to the same server (it gives the same username, password to all requests).
Execute multiple requests asynchronously, it assumes that all request are to the same server (it gives the same username, password, workstation and domain to all requests).
Get a cookie by name.
Get all cookies from this client.
void
Set proxy credentials.
void
Set proxy server.
Add cookie to the this client.
Add cookie to the this client.
Add cookie to the this client.
Add cookie to the this client.
Add cookie to the this client.
void
Sets a timeout in milliseconds for retrieving of data (when 0 there is no timeout).