Skip to content

feat: skill for http clients - #19

Merged
robhowley merged 2 commits into
mainfrom
http-clients
Mar 16, 2026
Merged

feat: skill for http clients#19
robhowley merged 2 commits into
mainfrom
http-clients

Conversation

@robhowley

Copy link
Copy Markdown
Owner
  • External HTTP calls are infrastructure boundaries — isolate them behind a dedicated client module
  • Use httpx.AsyncClient; never requests in async apps
  • Reuse a single managed client instance; never instantiate per request or per call site
  • Always configure explicit timeouts — connect, read, write, and pool
  • Use tenacity for retries; never hand-roll retry loops
  • Only retry transient failures on idempotent operations; don't retry 4xx
  • Validate external payloads into typed schemas before they cross into the app
  • Map upstream failures to domain-specific errors; don't leak HTTP concepts into business logic
  • Centralize auth, base URL, headers, and credentials — never scatter or hardcode them
  • Log and instrument at the boundary only; never log secrets
  • Structure as a thin base client (transport/retry/logging) + thin vendor client (endpoints/validation/mapping)
  • Make the integration layer trivially mockable in tests

@robhowley
robhowley merged commit 829fb74 into main Mar 16, 2026
3 checks passed
@robhowley
robhowley deleted the http-clients branch March 16, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant