improve network log

This commit is contained in:
2024-11-06 22:08:23 +08:00
parent 22f2ac99ad
commit 5234de434a

View File

@@ -196,12 +196,6 @@ class AppDio with DioMixin {
: rhttp.ProxySettings.proxy(proxy!), : rhttp.ProxySettings.proxy(proxy!),
)); ));
} }
Log.info(
"Network",
"${options?.method ?? 'GET'} $path\n"
"Headers: ${options?.headers}\n"
"Data: $data\n",
);
return super.request( return super.request(
path, path,
data: data, data: data,
@@ -238,6 +232,12 @@ class RHttpAdapter implements HttpClientAdapter {
Stream<Uint8List>? requestStream, Stream<Uint8List>? requestStream,
Future<void>? cancelFuture, Future<void>? cancelFuture,
) async { ) async {
Log.info(
"Network",
"${options.method} ${options.uri}\n"
"Headers: ${options.headers}\n"
"Data: ${options.data}\n",
);
var res = await rhttp.Rhttp.request( var res = await rhttp.Rhttp.request(
method: switch (options.method) { method: switch (options.method) {
'GET' => rhttp.HttpMethod.get, 'GET' => rhttp.HttpMethod.get,