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

request(method, apiPath, bodyopt, callback)

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>
callback function
Properties
Name Type Attributes Description
err Error <nullable>
status number
body Object | Array
Source:
Throws:
Wrong arguments.
Type
Error

Client(opts)

new Client(opts)

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

Methods

request(method, apiPath, bodyopt, callback)

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>
callback function
Properties
Name Type Attributes Description
err Error <nullable>
status number
body Object | Array
Source:
Throws:
Wrong arguments.
Type
Error