Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
|
Table Body (tbody) |
---|
id | createDeleteRequest-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createDeleteRequest |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new delete request (a request to delete a resource on server). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var client = plugins.http.createNewHttpClient();
var request = client.createDeleteRequest('http://www.servoy.com/delete.me');
var response = request.executeRequest();
var httpCode = response.getStatusCode(); // httpCode 200 is ok"
var content = response.getResponseBody(); |
|
|
|
|
Table Body (tbody) |
---|
id | createGetRequest-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createGetRequest |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| 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 http://wiki.servoy.com/display/tutorials/Import+a+%28Root%29+certificate+in+the+java+cacerts+file |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var client = plugins.http.createNewHttpClient();
var request = client.createGetRequest('http://www.servoy.com');
var response = request.executeRequest();
var httpCode = response.getStatusCode(); // httpCode 200 is ok"
var content = response.getResponseBody(); |
|
|
|
|
Table Body (tbody) |
---|
id | createHeadRequest-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createHeadRequest |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new head request (similar to get request, must not contain body content). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var client = plugins.http.createNewHttpClient();
var request = client.createHeadRequest('http://www.servoy.com');
var response = request.executeRequest();
var httpCode = response.getStatusCode(); // httpCode 200 is ok
var header = response.getResponseHeaders('last-modified'); |
|
|
|
|
Table Body (tbody) |
---|
id | createOptionsRequest-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createOptionsRequest |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new options request (a request for information about communication options). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var client = plugins.http.createNewHttpClient();
var request = client.createOptionsRequest('http://www.servoy.com');
var methods = request.getAllowedMethods(request.executeRequest()); |
|
|
|
|
Table Body (tbody) |
---|
id | createPostRequest-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createPostRequest |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| 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 http://wiki.servoy.com/display/tutorials/Import+a+%28Root%29+certificate+in+the+java+cacerts+file |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var client = plugins.http.createNewHttpClient();
var poster = client.createPostRequest('https://twitter.com/statuses/update.json');
poster.addParameter('status',globals.textToPost);
poster.addParameter('source','Test Source');
poster.setCharset('UTF-8');
var httpCode = poster.executeRequest(globals.twitterUserName, globals.twitterPassword).getStatusCode(); // httpCode 200 is ok |
|
|
|
|
Table Body (tbody) |
---|
id | createPutRequest-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createPutRequest |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new put request (similar to post request, contains information to be submitted). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var client = plugins.http.createNewHttpClient();
var request = client.createPutRequest('http://jakarta.apache.org');
request.setFile('UploadMe.gif');
var httpCode = putRequest.executeRequest().getStatusCode() // httpCode 200 is ok |
|
|
|
|
Table Body (tbody) |
---|
id | createTraceRequest-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createTraceRequest |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Creates a new trace request (debug request, server will just echo back). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var client = plugins.http.createNewHttpClient();
var response = request.executeRequest();
var httpCode = response.getStatusCode(); // httpCode 200 is ok"
var content = response.getResponseBody(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var cookie = client.getCookie('JSESSIONID');
if (cookie != null)
{
// do something
}
else
client.setCookie('JSESSIONID', 'abc', 'localhost', '/', -1, false) |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getCookies |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get all cookies from this client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var cookies = client.getHttpClientCookies() |
|
|
|
|
Table Body (tbody) |
---|
id | setClientProxyCredentials-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setClientProxyCredentials |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| setClientProxyCredentials |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Set proxy credentials. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| client.setClientProxyCredentials('my_proxy_username','my_proxy_password'); |
|
|
|
|
Table Body (tbody) |
---|
id | setCookie-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(cookieName, cookieValue) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add cookie to the this client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} cookieName - the name of the cookie {String} cookieValue - the value of the cookie |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var cookieSet = client.setCookie('JSESSIONID', 'abc', 'localhost', '/', -1, false)
if (cookieSet)
{
//do something
} |
|
|
|
|
Table Body (tbody) |
---|
id | setCookie-String_String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(cookieName, cookieValue, domain) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add cookie to the this client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} cookieName - the name of the cookie {String} cookieValue - the value of the cookie {String} domain - the domain |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var cookieSet = client.setCookie('JSESSIONID', 'abc', 'localhost', '/', -1, false)
if (cookieSet)
{
//do something
} |
|
|
|
|
Table Body (tbody) |
---|
id | setCookie-String_String_String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(cookieName, cookieValue, domain, path) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add cookie to the this client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} cookieName - the name of the cookie {String} cookieValue - the value of the cookie {String} domain - the domain {String} path - the path |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var cookieSet = client.setCookie('JSESSIONID', 'abc', 'localhost', '/', -1, false)
if (cookieSet)
{
//do something
} |
|
|
|
|
Table Body (tbody) |
---|
id | setCookie-String_String_String_String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(cookieName, cookieValue, domain, path, maxAge) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add cookie to the this client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} cookieName - the name of the cookie {String} cookieValue - the value of the cookie {String} domain - the domain {String} path - the path {Number} maxAge - maximum age of cookie |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var cookieSet = client.setCookie('JSESSIONID', 'abc', 'localhost', '/', -1, false)
if (cookieSet)
{
//do something
} |
|
|
|
|
Table Body (tbody) |
---|
id | setCookie-String_String_String_String_Number_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(cookieName, cookieValue, domain, path, maxAge, secure) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add cookie to the this client. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} cookieName - the name of the cookie {String} cookieValue - the value of the cookie {String} domain - the domain {String} path - the path {Number} maxAge - maximum age of cookie {Boolean} secure - true if it is a secure cookie, false otherwise |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var cookieSet = client.setCookie('JSESSIONID', 'abc', 'localhost', '/', -1, false)
if (cookieSet)
{
//do something
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setTimeout |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Sets a timeout in milliseconds for retrieving of data (when 0 there is no timeout). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| client.setTimeout(1000) |
|
|
|
|
|