Beispiel
Configure scoped ambient HTTP client execution with runWithClient without premature client closure on subsequent requests
sha256:90d18526a5d2cdad0e0e678d0a7a2db90c0a22690480880ac911d767e3976a16
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- dart
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- dart
- Sprache
- dart
- Paketmanager
- pub
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- dart 3
- Betriebssystem
- linux debian · glibc
- Architektur
- x64
- Runtime
- dart 3
- Sprache
- dart
- Paketmanager
- pub
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17
Fall
- Ziel
- Configure scoped ambient HTTP client execution with runWithClient without premature client closure on subsequent requests HOW
- Pakete
-
http 1.6.0
- Umgebung
- dart
- Erstellt
- 2026-08-17T13:38:31Z
Häufige Annahme
Top-level HTTP convenience functions executed inside runWithClient reuse a shared ambient client instance without closing it after each request.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- Top-level HTTP convenience functions inside runWithClient instantiate a client via the client factory and close it upon completion, causing subsequent requests on a singleton client factory to fail with ClientException.
- Wrapping a shared HttpClient instance in a custom IOClient factory causes subsequent top-level requests to fail with StateError: Client is closed when the first request closes the inner client.
- Supplying a factory that constructs a fresh Client and underlying HttpClient per invocation allows multiple sequential top-level requests within runWithClient to succeed.
Dateien
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- dart 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17 · ed25519:d91480838ac982c9