These functions allow you to access resources on external HTTP servers.
| Function | Description |
|---|---|
| getExternalResource(url, options) | Makes a request to access resources on an external HTTP server.
Note: An X.509 certificate blob (used in SSO) cannot be used as a client certificate for HTTPS communication. In other words, you can use only client certificates from trusted certificate authorities, which means that self-signed certificates do not work.
|
| complete( resultXHR ) | The complete(resultXHR) callback is sent when getExternalResource finishes. Its input is a resultXHR structure which closely mirrors the JavaScript XmlHttpRequest object. The fields/methods available on resultXHR are:
These fields and methods are not supported for resultXHR:
|
function update() {
// Using json to update a value
var url = // URL of your external resource;
var webResponse;
var options = {
method: "PUT",
data: "{\"Value\":\"Value A Updated\"}",
headers: {
"Content-type": "application/json"
},
async: false,
complete: function(response) { webResponse = response; }
};
getExternalResource(url, options);
if (webResponse.status === 200)
alert("Update successful");
else
alert("Update Failed");
}
function delete() {
// Delete a value
var url = // URL of your external resource;
var webResponse;
var options = {
method: "DELETE",
async: false,
complete: function(response) { webResponse = response; }
};
getExternalResource(url, options);
if (webResponse.status === 200)
alert("Delete successful");
else
alert("Delete Failed");
}