This service connects to the custom REST endpoints.
Example
// GET request
customRestRequestService.get("testrestinteraction", "myrestendpoint/get").then(function(data) {
// do something with the response
}, function(err){
// handle error
});
// POST request
customRestRequestService.post("testrestinteraction", "myrestendpoint/post", {
data: {
"datafromclient": "mydatafromclient"
},
query: {
abc: "123"
}
}).then(function(data) {
// do something with the response
}, function(err){
// handle error
});
// PUT request
customRestRequestService.put("testrestinteraction", "myrestendpoint/put").then(function(data) {
// do something with the response
}, function(err){
// handle error
});
// DELETE request
customRestRequestService.del("testrestinteraction", "myrestendpoint/delete").then(function(data) {
// do something with the response
}, function(err){
// handle error
});
Functions
-
del(pluginId, path, config)dojo/Deferred
-
Function to execute a DELETE request on a custom REST endpoint
Name Type Description pluginId string ID of the plugin to call custom REST endpoint on
path string the path of the request
config object see dojo/request/xhr
Returns:
Type Description dojo/Deferred -
get(pluginId, path, config)dojo/Deferred
-
Function to execute a GET request on a custom REST endpoint
Name Type Description pluginId string ID of the plugin to call custom REST endpoint on
path string the path of the request
config object see dojo/request/xhr
Returns:
Type Description dojo/Deferred -
post(pluginId, path, config)dojo/Deferred
-
Function to execute a POST request on a custom REST endpoint
Name Type Description pluginId string ID of the plugin to call custom REST endpoint on
path string the path of the request
config object see dojo/request/xhr
Returns:
Type Description dojo/Deferred -
put(pluginId, path, config)dojo/Deferred
-
Function to execute a PUT request on a custom REST endpoint
Name Type Description pluginId string ID of the plugin to call custom REST endpoint on
path string the path of the request
config object see dojo/request/xhr
Returns:
Type Description dojo/Deferred