Skip to main content

%DocDB.REST

class %DocDB.REST extends %CSP.REST

This class implements a custom response format and serves as the basis for all DocDB REST APIs

Method Inventory

Parameters

parameter DOMAIN = %DOCDB;
Inherited description: Login page localization domain

Methods

classmethod AccessibleNamespaces()
This method returneds a list of accessible namespaces
classmethod Http500(pE As %Exception.AbstractException) as %Status
Use our special format Http500 handler
classmethod Page(skipheader As %Boolean = 1) as %Status
Sets the response's localization domain (something that %CSP.REST should do, in theory) and then invokes default super class behavior
classmethod RenderResponseBody(httpStatus As %String = "", error As %DynamicAbstractObject = "", content As %DynamicAbstractObject = "") as %Status
Render the three-part Response Body which contains an status, console, and a result part
classmethod ReportHttpStatusCode(httpStatus, status As %Status = $$$OK) as %Status
User our special format handler for other status codes
classmethod SQLCODEToHttpStatus(SQLCODE As %Integer) as %String
classmethod ServeXml(pDocName As %String, pStatus As %Status, pMsgArray As %DynamicArray, pStream As %Stream, pTimeStamp As %String = "") as %Status
This private helper method server wraps the message and document and returns it to the caller
classmethod SetClientServerHash(pHash As %String)
Set the clients version of the server hash
classmethod exceptionToHttpResponse(exception As %Exception.AbstractException) as %String
set status = exception.AsStatus() do ..StatusToJSON(status,.statusObject) All exceptions can have an inner exception Status exceptions can also have NextException, forming a linked list structure This can be normalized by converting the exception to a dynamic object and then we process the dynamic object
classmethod exceptionToHttpStatus(exception As %Exception.AbstractException) as %Library.DynamicAbstractObject
Map an exception graph to an http status code
classmethod getRequestBody() as %DynamicAbstractObject

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab