dcHttpExt 1.0

A simple API client


The Pod provides the Axon function - dcHttp(). The function provides a simple, lightweight, single method implementation for REST API calls. The method can be used to retrieve, or create new records at an external API address. Users of this extension are welcome to use, edit and add to the extension and related source code as they see fit.


  • dcHttp(uri,headers,body,method)
  • uri - enclosed with ` characters.
  • method - Must be a of type string, either GET or POST. Cannot be null.
  • headers - Must be one of; an empty dict, a dict of key-value pairs, or null.
  • body - Must be of type string, or null. If dict is required for body data (Common to have json body data for an api request), the dict must be enclosed all in a string, then use escape characters for the inner quotations (see code example 2). If body data is present, header must contain a content-type header (typically "application/json").
  • return type - The response body of the call, as type String. At this stage, other response data is only available implicitly.


  1. We perform a "GET" request to our blogs api, no headers or body are provided.
    () => do
      uri: `https://exampleblog/posts/5`
      method: "GET"
      headers: null
      body: null
      return dcHttp(uri,headers,body,method)
  2. We perform a "POST" request to our blogs api, to create a new record. A content type is specified in the header, with body data described as a string enclosed dictionary.
    () => do
      uri: `https://exampleblog.com/new`
      method: "POST"
      headers: {"Content-Type":"application/json"}
      body: "{\"key1\":\"value1\",\"key2\":\"value2\"}"
      return dcHttp(uri,headers,body,method)


Efforts have been made to mitigate run time exceptions, and to help with compiler exceptions. Please send bug reports to [email protected]

NOTE: Built for SkySpark 3.0.13