Skip to main content

%REST.Impl

class %REST.Impl extends %Library.RegisteredObject

Abstract superclass for REST implementation classes generated from OpenAPI specifications.

Method Inventory

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
Check that the ACCEPT request header is included in the produces list.
classmethod %DeleteHeader(name As %String)
Remove a header from the response. Note that name is not case sensitive
classmethod %GetContentType()
Get the content-type header of the request
classmethod %GetHeader(name As %String) as %String
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)
Log an API Management error
classmethod %ReportRESTError(statusCode As %String, sc As %Status, exposeServerExceptions As %Boolean = 0)
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)
Set the content-type header of the response
classmethod %SetCookieFromHeader(cookie As %String)
Sets a custom HTTP Cookie into the reply. Takes the value of a Set-Cookie header as a String and parses out its properties. These include name,value,expires,path,etc... Created for use with WSGI.
classmethod %SetHeader(name As %String, value As %String)
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
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)
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.htmlOpens in a new tab
classmethod %WriteResponse(response)
%WriteResponse is used by the dispatch class to write the response to this request.

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab