Ejemplo
Configure scoped ambient HTTP client execution with runWithClient without premature client closure on subsequent requests
sha256:90d18526a5d2cdad0e0e678d0a7a2db90c0a22690480880ac911d767e3976a16
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- dart
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- dart
- Lenguaje
- dart
- Gestor de paquetes
- pub
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- dart 3
- Sistema operativo
- linux debian · glibc
- Arquitectura
- x64
- Runtime
- dart 3
- Lenguaje
- dart
- Gestor de paquetes
- pub
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17
Caso
- Objetivo
- Configure scoped ambient HTTP client execution with runWithClient without premature client closure on subsequent requests HOW
- Paquetes
-
http 1.6.0
- Entorno
- dart
- Creado
- 2026-08-17T13:38:31Z
Lo que suele suponerse
Top-level HTTP convenience functions executed inside runWithClient reuse a shared ambient client instance without closing it after each request.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- 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.
Archivos
- NOTES.md
- csx.json
- pubspec.lock
- pubspec.yaml
- test/contract.dart
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- dart 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · pub@1 · 2026-08-17 · ed25519:d91480838ac982c9