printHttpRequest function
void
printHttpRequest({})
Logs an outgoing HTTP request without coupling to http or dio.
Implementation
void printHttpRequest({
required String method,
required String url,
Map<String, Object?>? headers,
Object? body,
Iterable<String>? files,
String? tag = 'HTTP',
}) {
printfBox(
'$method REQUEST',
[
'URL : $url',
if (headers != null && headers.isNotEmpty) 'HEADERS : $headers',
if (body != null) 'BODY : ${_formatPayload(body)}',
if (files != null && files.isNotEmpty) 'FILES : ${files.join(', ')}',
].join('\n'),
level: PrintfLevel.info,
tag: tag,
);
}