%REST.Impl

class %REST.Impl extends %Library.RegisteredObject

Abstract superclass for REST implementation classes generated from OpenAPI specifications.

Method Inventory (Including Private)

Parameters

parameter ExposeServerExceptions = 0;
If ExposeServerExceptions is overridden as true, then details of internal errors will be exposed.

Methods

classmethod %CheckAccepts(produces As %String) as %Boolean [ Language = objectscript ]
Check that the ACCEPT request header is included in the produces list.
classmethod %DeleteHeader(name As %String) [ Language = objectscript ]
Remove a header from the response. Note that name is not case sensitive
classmethod %GetContentType() [ Language = objectscript ]
Get the content-type header of the request
classmethod %GetHeader(name As %String) as %String [ Language = objectscript ]
Return the value of the name request header. Note that name is not case sensitive
classmethod %LogError(methodName As %String, error As %String, data As %String) [ Language = objectscript ]
Log an API Management error
classmethod %ReportRESTError(statusCode As %String, sc As %Status, exposeServerExceptions As %Boolean = 0) [ Language = objectscript ]
Report an error when processing a request. The implementation class may contain an override of %ReportRESTError in order to format the error response as required by the REST application. The override should use the %WriteResponse method to return the error response.
classmethod %SetContentType(contentType As %String) [ Language = objectscript ]
Set the content-type header of the response
classmethod %SetHeader(name As %String, value As %String) [ Language = objectscript ]
Sets a custom HTTP header into the reply. If you set the same header twice it will append the information to the first with a ',' between them. Note that name is not case sensitive, however we will remember the case of the header when sending this to the client.
classmethod %SetHeaderIfEmpty(name As %String, value As %String) as %Boolean [ Language = objectscript ]
Helper method that sets a header if it is currently empty, if it already has a value it does nothing. Returns true if the header was set and false if it did nothing.
classmethod %SetStatusCode(statusCode As %String) [ Language = objectscript ]
The HTTP Status code to be sent back in the response. The HTTP status codes are defined in RFC 2068.

http://www.faqs.org/rfcs/rfc2068.html
classmethod %WriteResponse(response) [ Language = objectscript ]
%WriteResponse is used by the dispatch class to write the response to this request.

Inherited Members

Inherited Methods (Including Private)

Subclasses

Feedback