Skip to main content

flog_flow_http 0.7.0 copy "flog_flow_http: ^0.7.0" to clipboard
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).

flog_flow_http #

package:http client for flog_flow: every request shows up in the session timeline of the exported .html (method, URL, status and timing; headers and bodies depending on CaptureConfig).

Usage #

Use FlogHttpClient wherever you use an http.Client:

import 'package:flog_flow_http/flog_flow_http.dart';

final client = FlogHttpClient();
final res = await client.get(Uri.parse('https://api.example.com/products'));

It can wrap any other client (RetryClient, cupertino_http, cronet_http…):

final client = FlogHttpClient(inner: RetryClient(http.Client()));

To also record the top-level functions (http.get, http.post…) and any package that creates its own http.Client(), install it for the whole app:

void main() {
  http.runWithClient(() => runApp(const MyApp()), () => FlogHttpClient());
}

Responses keep streaming as usual: the client copies the body while it is read (only text, up to the configured limit) and records the request when the body has been read to the end.

What gets stored is controlled by flog_flow's CaptureConfig:

  • captureNetwork (default true): method, host, path, status and duration.
  • captureNetworkBodies (default true): also the full URL and a preview of the request and response bodies.
  • offlineMode (default false): full bodies and request/response headers, so the viewer can rebuild the request as cURL. Those are sensitive (tokens, cookies): don't share that file outside your team.

Using Dio instead? See flog_flow_dio.

0
likes
150
points
266
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

package:http client for flog_flow. Wraps any http.Client and records every request in the session timeline (status, timing, headers and bodies).

Topics

#debugging #network #http

License

MIT (license)

Dependencies

flog_flow, flutter, http

More

Packages that depend on flog_flow_http