IRISLIB database
Http Class Reference

This class implements various utility functions for HTTP. More...

Static Public Member Functions

_.Library.DynamicAbstractObject GetJson (_.Library.RawString requestURL, _.Library.String request)
 

Detailed Description

This class implements various utility functions for HTTP.

Member Function Documentation

◆ GetJson()

_.Library.DynamicAbstractObject GetJson ( _.Library.RawString  requestURL,
_.Library.String  request 
)
static

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 <class>Library.DynamicAbstractObject</class>. The properties contained in request must be named the same as a property in <class>Net.HttpRequest</class>. The exception is the url property. Any other property contained in request that is not named the same as a property in <class>Net.HttpRequest</class> 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().