getUnauthenticatedResource method

Future<String?> getUnauthenticatedResource(
  1. String path, {
  2. Map<String, String>? headers,
  3. String? method,
  4. String? encoding,
  5. Map<String, String>? params,
  6. String? body,
})

Implementation

Future<String?> getUnauthenticatedResource(
  String path, {
  Map<String, String>? headers,
  String? method,
  String? encoding,
  Map<String, String>? params,
  String? body,
}) async {
  try {
    var response = await Onegini.instance.channel
        .invokeMethod(Constants.getUnauthenticatedResource, <String, dynamic>{
      'path': path,
      'headers': headers,
      'method': method,
      'encoding': encoding,
      'parameters': params,
      'body': body
    });
    return response;
  } on TypeError catch (error) {
    throw PlatformException(
        code: Constants.wrapperTypeError.code.toString(),
        message: Constants.wrapperTypeError.message,
        stacktrace: error.stackTrace?.toString());
  }
}