Skip to main content

%Net.Http

abstract class %Net.Http

This class implements various utility functions for HTTP.

Method Inventory

Methods

classmethod %DispatchClassMethod(class As %String, method As %String, args...) as %ObjectHandle
classmethod GetJson(requestURL As %RawString = "", request As %String(MAXLEN="")="") as %DynamicAbstractObject [ SQLProc = GetJson ]
Projected as the stored procedure: GetJson

GetJson() is a utility function that accepts a URL and an optional request object. If a request object is supplied then it is expected to be either JSON or an oref. The properties of the request object will be used to populate the HttpRequest before submitting the request. The response is expected to be encoded as JSON.

If request is passed then it must either be valid JSON or an oref of type %Library.DynamicAbstractObject. The properties contained in request must be named the same as a property in %Net.HttpRequest. The exception is the url property. Any other property contained in request that is not named the same as a property in %Net.HttpRequest will trigger an exception:

If requestURL is not passed or is passed as null then the request.url property is used as the URL.

This method is projected as an SQL function and can be invoked in SQL as %Net.GetJson().

FeedbackOpens in a new tab