setResponseHeaders method

Future<RequestTracker> setResponseHeaders(
  1. Map<String, List<String>> responseHeaders
)

Sets a dictionary representing the keys and values from the server response's headers.

If an error occurred and a response was not received, this should not be called.

Method might throw Exception.

Implementation

Future<RequestTracker> setResponseHeaders(
    Map<String, List<String>> responseHeaders) async {
  try {
    final args = {"id": id, "headers": responseHeaders};
    await channel.invokeMethod<void>(
        'setRequestTrackerResponseHeaders', args);
    return this;
  } on PlatformException catch (e) {
    throw Exception(e.details);
  }
}