onRequest method
Implementation
void onRequest(
HttpClientRequest request, {
String? requestBody,
}) {
final NetworkRequest networkRequest = NetworkRequest();
networkRequest.startTime = DateTime.now();
networkRequest.method = request.method;
networkRequest.url = request.uri.toString();
networkRequest.requestBody = _removeBinaryData(requestBody);
request.headers.forEach((String header, dynamic value) {
networkRequest.requestHeaders[header] = value[0].toString();
});
_requests[request.hashCode] = networkRequest;
}