post static method

Future<Map<String, dynamic>?> post({
  1. required String bridgeIpAddr,
  2. String? pathToResource,
  3. required String applicationKey,
  4. required ResourceType? resourceType,
  5. required String body,
})

Create a new resource.

bridgeIpAddr is the IP address of the target bridge.

If a specific resource is being queried, include pathToResource. This is most likely the resource's ID.

applicationKey is the key associated with this devices in the bridge's whitelist.

The resourceType is used to let the bridge know what type of resource is being queried.

body is the actual content being sent to the bridge.

Implementation

static Future<Map<String, dynamic>?> post({
  required String bridgeIpAddr,
  String? pathToResource,
  required String applicationKey,
  required ResourceType? resourceType,
  required String body,
}) async =>
    await HueHttpClient.post(
      url: getTargetUrl(
        bridgeIpAddr: bridgeIpAddr,
        resourceType: resourceType,
        pathToResource: pathToResource,
      ),
      applicationKey: applicationKey,
      body: body,
    );