setRequestHeaders method

Future<RequestTracker> setRequestHeaders(
  1. Map<String, List<String>> requestHeaders
)

Sets a dictionary representing the keys and values from the client request's headers.

Currently used for propagating the request's Content-Length header.

Method might throw Exception.

Implementation

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