buildRequest function
Builds a shelf Request for testing extractors without a router.
Implementation
Request buildRequest(
String method,
String path, {
Map<String, String> headers = const {},
Object? body,
Map<String, String> pathParameters = const {},
Map<String, Object> context = const {},
}) {
return Request(
method,
Uri.parse('http://localhost$path'),
headers: headers,
body: body,
context: {
if (pathParameters.isNotEmpty) pathParametersKey: pathParameters,
...context,
},
);
}