Open
Description
I'm working on a server mocking library. Something like nock for Javascript, but for Dart/Flutter.
I have an issue with constructing HttpHeaders
because package dart:http
doesn't provide any constructor for it.
Thus, I have to either implement all the functionality by myself, either use a weird workaround:
Future<HttpHeaders> createHeaders() async {
final request = await originalHttpClient.head("localhost", 0, "");
return request.headers;
}
Both solutions are not so good and have disadvantages.