netlens_http_client 1.0.0
netlens_http_client: ^1.0.0 copied to clipboard
NetLens adapter for dart:io HttpClient. Catches HttpClient calls for the NetLens in-app HTTP inspector and lets NetLens resend them.
NetLens for HttpClient from dart:io #
Connects NetLens, the in-app HTTP inspector for Flutter, to HttpClient from dart:io.
Install #
dependencies:
netlens: ^1.1.0
netlens_http_client: ^1.0.0
Use #
import 'dart:io';
import 'package:netlens/netlens.dart';
import 'package:netlens_http_client/netlens_http_client.dart';
final netLens = NetLens();
final adapter = NetLensHttpClientAdapter();
netLens.addAdapter(adapter);
HttpClient()
.getUrl(Uri.parse('https://api.example.com/users'))
.interceptWithNetLens(adapter);
Mocks #
To replay mocks recorded by NetLens, start NetLensMockServer and point your
requests at its URL:
final server = NetLensMockServer(resolver: netLens.mocks);
final Uri baseUrl = await server.start();
See Mocks.
Documentation #
You can find the documentation here.
Credits #
NetLens is a fork of Alice by Jakub Homlala and its contributors, licensed under the Apache License 2.0.