flog_flow_http 0.7.0
flog_flow_http: ^0.7.0 copied to clipboard
package:http client for flog_flow. Wraps any http.Client and records every request in the session timeline (status, timing, headers and bodies).
example/example.md
Example #
import 'package:flog_flow_http/flog_flow_http.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
// Every http.Client() created in the app (and http.get, http.post…) records
// its requests in the flog_flow session.
http.runWithClient(() => runApp(const MyApp()), () => FlogHttpClient());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) => const MaterialApp(home: Placeholder());
}
// Or, for a single client:
final api = FlogHttpClient();
Future<void> load() => api.get(Uri.parse('https://api.example.com/products'));