Performs a REST HTTP DELETE call and returns the HTTP response code. Returns a RestResponse representing the response.
A DELETE is used to delete a resource if it exists. The response code returned is 200 if successfully deleted or 404 if the resource does not exist.
Example:
//set any headers
var headers = {};
//set params
var params = {"userId":fields.filter.value};
var opts = new RestOptions();
//setting the wait time to establish a connection to the target server to 5 seconds
opts.setConnectionTimeout(5);
//set the time to wait for no inactivity from the rest call to 10 seconds
opts.setSocketTimeout(10);
var response = services.rest.delete("myGateway", "/users", headers, params, opts);
if(response.isSuccess())
{
//display success message
}
else
{
//display failure message
}
Example:
Further documentation.