Class Batch

Hierarchy

Index

Constructors

Methods

Constructors

constructor

Methods

request

  • request(batchData: BatchData[], async?: boolean): Promise<any>
  • Send a batch commands Examples:

    [
      {"method": "GET", "endpoint": "/data", "headers": {"token": "38935657-8491-4702-b951-a03374410db0"} },
      {"method": "GET", "endpoint": "/device" }
    ]

    Parameters

    • batchData: BatchData[]
    • Default value async: boolean = false

      Async=true method send all commands in same time, Async=false send command one by one, and stop if got a error

    Returns Promise<any>