Request constructor

Request({
  1. required Route route,
  2. Map<String, dynamic>? parameters,
  3. Map<String, String>? headers,
  4. Map<String, dynamic>? body,
})

Implementation

Request({required Route route, this.parameters, this.headers, this.body}) {
  String path = route.path;

  if (parameters != null) {
    parameters!.forEach((key, value) {
      path = path.replaceAll('{$key}', parameters![key]);
    });
  }

  this.path = path;
}