Performs a REST HTTP PATCH call supplying any headers and/or parameters required. Returns a RestResponse representing the response.
A PATCH call should be used for a partial update to a resource.
HTTP response headers - returns list of response headers as key-->value pairs. e.g "WWW-Authenticate", "Gateway"
Response body - returns the response body if the response is successful. If there is no response, this value will be null.
Example:
var user = {};
user.title = 'foo';
//set any headers
var headers = {"Content-Type":"application/json", "Accept":"application/json"};
//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.patch("myGateway", "/update/users", JSON.stringify(user), headers, params, opts);
if(response.isSuccess())
{
var result = JSON.parse(response.getBody());
if(result)
{
//populate response using the JSON object
displayResult(result);
}
}
RestResponse contains the following data:
Example:
Further documentation.