Skip to main content
Skip table of contents

getRestHttpResponse() Function

Syntax
NONE
set aResponseObject = getRestHttpResponse()
Semantics

Returns a HTTP response object. Set the details of this object to return them to the caller.

getRestHttpResponse() is only applicable in REST service context. In other contexts, e.g. if called via a SOAP shadow port (and thus SOAP context), getRestHttpRequest() will return NULL.

SubstitutablesaResponseObject

An object of type Base Components::Add Ons::REST::Response:

Examples
NONE
create myErrorObject;
set error.code = "400";
set error.message = "Bad request.";

local response = getRestHttpResponse();
set response.responseObject = myErrorObject;
set response.httpStatus = "400";
getRestHttpResponse() can be used to impement REST error handling. Refer to REST Service Error Handling for more details.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.