You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 5 Next »
This class helps you to create a REST response to a scripted REST API Request.
Sets the response content.
Parameter:
Return:
Example:
let body = {}; body.name = 'incident'; body.number = '1234'; body.caller = {'id': 'user1'}; response.setBody(body);
This method allows to assign a value to a REST service response header.
Parameters:
response.setHeader("Location","<URI>");
Sets the headers for the web service response.
let headers = {}; headers.X-Total-Count=100; headers.Location='https://instance.simpleone.ru/<endpoint_to_resource>'; response.setHeaders(headers);
This method sets the status code number for the service response.
response.setStatus(200);