Skip to main content

EnsLib.REST.Service

abstract class EnsLib.REST.Service extends EnsLib.HTTP.Service, %CSP.REST, Ens.Util.JSON

REST Service class. Can use an HTTP InboundAdapter listener, or the standard CSP Service mechanism, or both. In order for the CSP mechanism to work, HTTP Services using this class must be configured with the invoking URL including ?CfgItem= giving the config item name. (Configured Services exposed using the HTTP Inbound Adapter may also be invoked with this URL parameter but because each configured Inbound Adapter listens on its own TCP/IP port this parameter is just a safety check for them.)

Method Inventory

Parameters

parameter ADAPTER = EnsLib.HTTP.InboundAdapter;
Inherited description: Name of the adapter class - override this to "" if you want to use only the regular HTTP mechanism and not the custom-port HTTP InboundAdapter.
parameter EnsServicePrefix;
This prefix will be removed from the beginning of the actual URL before matching it against the UrlMap. If this prefix begins with '^' then the CSP Application will also be removed from the beginning of the URL if this service is being invoked via the CSP gateway. If this prefix begins with '|' then the Config Name for this service will be removed from the beginning of the URL, as well as the CSP Application if this service is being invoked via the CSP gateway.
parameter PREFIXCASESENSITIVE = 0;

Methods

classmethod Http405(pSupportedVerbs As %String = "") as %Status
Issue a '405' error ( user can override)
method OnProcessInput(pInput As %Library.AbstractStream, Output pOutput As %Stream.Object = $$$NULLOREF, ByRef pHint As %Library.String) as %Status
Override this method in your subclass if you want to handle dispatching yourself. This implementation paraphrases the %CSP.REST:DispatchRequest() implementation with modifications to support the input and output streams used by the HTTP Adapter.
final classmethod Page(skipheader As %Boolean = 1) as %Status
Inherited description: This method matches the request and method and calls the dispatcher
classmethod ReportHttpStatusCode(pHttpStatus, pSC As %Status = $$$OK) as %Status
Issue an HTTP error

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab