Class: Client

Client()

new Client()

The HTTP client to request Sylvia-IoT APIs. With this client, you do not need to handle 401 refresh token flow.
Source:

Methods

(async) request(method, apiPath, bodyopt) → {Promise.<ClientResponse>}

Execute a Sylvia-IoT API request.
Parameters:
Name Type Attributes Description
method string
apiPath string The relative path (of the coremgr base) the API with query string. For example: `/api/v1/user/list?contains=word`, the client will do a request with `http://coremgr-host/coremgr/api/v1/user/list?contains=word` URL.
body Object <optional>
Source:
Throws:
  • Wrong arguments.
    Type
    Error
  • SdkError
Returns:
Type
Promise.<ClientResponse>

Client(opts)

new Client(opts)

Create an instance.
Parameters:
Name Type Description
opts ClientOptions
Source:
Throws:
Wrong arguments.
Type
Error

Methods

(async) request(method, apiPath, bodyopt) → {Promise.<ClientResponse>}

Execute a Sylvia-IoT API request.
Parameters:
Name Type Attributes Description
method string
apiPath string The relative path (of the coremgr base) the API with query string. For example: `/api/v1/user/list?contains=word`, the client will do a request with `http://coremgr-host/coremgr/api/v1/user/list?contains=word` URL.
body Object <optional>
Source:
Throws:
  • Wrong arguments.
    Type
    Error
  • SdkError
Returns:
Type
Promise.<ClientResponse>