Skip to main content
Skip table of contents

getRestHttpResponse() Function

Syntax

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.

Substitutables

aResponseObject

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 implement REST error handling.

JavaScript errors detected

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

If this problem persists, please contact our support.