io_fetch library

The wallet's HTTP over dart:io, as the kit wants it: ioFetch for Config.http or enginePayout(http:).

A library of its own (package:cashucard/io_fetch.dart), so that package:cashucard/cashucard.dart imports no dart:io. An app that reaches mints over Tor or a proxy brings its own fetch through dartFetch instead, holding it to the same three rules: no redirect followed, at most 4 MiB of an answer read, calls at once taken.

Functions

ioFetch({Duration timeout = const Duration(seconds: 20), HttpClient? client}) → HttpFetch
The wallet's HTTP over dart:io (clearnet): no redirect followed, at most 4 MiB of an answer read, timeout for each call (20 seconds for a mint; give the engine's payout one of its own with 45), and calls at once taken (the kit asks the keys of up to eight keysets together). client: one of the app's own (its proxy, its certificates); none, one made here. A redirect is not followed even when client would.
ioSend(HttpClient client, HttpRequest r, {Duration timeout = const Duration(seconds: 20)}) → Future<HttpResponse>
One call of ioFetch: r sent over client, no redirect followed (a 3xx answered as it came, which the kit reads as no answer), at most fetchBodyMost bytes of the answer read (one that runs past it, or says it will, throws: no answer, and it is never held whole), an answer that is not UTF-8 refused (so its text is never longer than its bytes, and dartFetch's cap on the text is the same 4 MiB), the whole call given timeout. Past the timeout nothing more is sent: a request still waiting for its connection (a client of the app's with few connections a host, say) is aborted as soon as it has one, before a byte of it leaves, so a swap the kit has taken for unanswered never reaches the mint later. Nothing is kept between calls, so any number may run at once.