RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

Class

RequestHelper

A Helper Class to abstract away the Lower-Level Fetch API to suit calls to the RICADO Gen 4 API

Constructor

new RequestHelper()

Source

Methods

static

deleteRequest(url, queryParametersopt) → {Promise.<boolean>}

Perform a DELETE Request

Parameters

  • url string

    The Relative URL (e.g. /sites/{siteId}/my-resource)

  • queryParameters Object.<string, any> <optional>

    Query Parameters (e.g. {myQuery: myValue})

Returns

  • Promise.<boolean>

Source

static

getRequest(url, queryParametersopt) → {Promise.<any>}

Perform a GET Request

Parameters

  • url string

    The Relative URL (e.g. /sites/{siteId}/my-resource)

  • queryParameters Object.<string, any> <optional>

    Query Parameters (e.g. {myQuery: myValue})

Returns

  • Promise.<any>

Source

static

patchRequest(url, dataopt) → {Promise.<any>}

Perform a PATCH Request

Parameters

  • url string

    The Relative URL (e.g. /sites/{siteId}/my-resource)

  • data any <optional>
    null

    The Data to PATCH

Returns

  • Promise.<any>

Source

static

performRequest(method, url, dataopt, queryParametersopt) → {Promise.<any>}

Performs a Request (fetch)

Parameters

  • method string

    The Request Method

  • url string

    The Relative URL

  • data any <optional>
    null

    The Data to send with this Request

  • queryParameters Object.<string, any> <optional>

    Query Parameters (e.g. {myQuery: myValue})

Returns

  • Promise.<any>

Source

static

postRequest(url, dataopt) → {Promise.<any>}

Perform a POST Request

Parameters

  • url string

    The Relative URL (e.g. /sites/{siteId}/my-resource)

  • data any <optional>
    null

    The Data to POST

Returns

  • Promise.<any>

Source

static

putRequest(url, dataopt) → {Promise.<any>}

Perform a PUT Request

Parameters

  • url string

    The Relative URL (e.g. /sites/{siteId}/my-resource)

  • data any <optional>
    null

    The Data to PUT

Returns

  • Promise.<any>

Source