create static method

Future create(
  1. String? name,
  2. String? bridgeId,
  3. List<String>? type
)

Implementation

static Future<dynamic> create(
    String? name, String? bridgeId, List<String>? type) async {
  var queryParams = {
    'name': name,
    'bridgeId': bridgeId,
    'type': type != null ? type.join(',') : "",
  };

  var path = bridgeId != null ? "ari/bridges/${bridgeId}" : "ari/bridges";
  var uri = Uri(
      scheme: "http",
      userInfo: "",
      host: "10.44.0.55",
      port: 8088,
      path: path,
      queryParameters: {
        'api_key': api_key,
        'bridgeId': bridgeId,
        'type': type != null ? type.join(',') : ""
      }
      //String? fragment
      );
  //var uri = Uri.http(baseUrl, '/bridges', queryParams);

  /// print(uri); // http://example.org/path?q=dart
  HttpClientRequest request = await client.postUrl(uri);
  HttpClientResponse response = await request.close();
  //print(response);

  final String stringData = await response.transform(utf8.decoder).join();
  //print(response.statusCode);
  //print(stringData);
  return (statusCode: response.statusCode, resp: stringData);
}