Skip to content
Back to skills

Http Client

ASecurity

Build a robust HTTP client with timeouts, bounded retries, backoff, and connection reuse

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 3, 2026
ai-agentsgoapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill http-client --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Http Client?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Http Client
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-http-client/badge)](https://www.skillsdirectory.com/skills/black141312-http-client)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: http-client
description: Build a robust HTTP client with timeouts, bounded retries, backoff, and connection reuse
category: networking
---

# HTTP Client

Use whenever code calls an external HTTP API and must survive flaky networks and slow upstreams. A naive `fetch`/`get` with no timeout is a production incident waiting to happen.

1. Set explicit timeouts on every request — connect, read/idle, and a total deadline — so a hung server can't pin a thread or goroutine forever.
2. Reuse one client/connection pool instance across calls (keep-alive); creating a client per request exhausts sockets.
3. Retry only idempotent, transient failures (connection errors, 429, 5xx) with exponential backoff + jitter and a hard cap on attempts.
4. Honor `Retry-After` on 429/503; respect server-provided backoff over your own schedule.
5. Add a circuit breaker or failure budget so a dead dependency fails fast instead of amplifying load with retries.
6. Propagate cancellation (context/`AbortSignal`), set a descriptive `User-Agent`, and check status codes explicitly — don't assume 2xx.

## Rules
- Never retry non-idempotent requests (`POST` without an idempotency key) — you'll double-charge, double-send, double-create.
- Add jitter to backoff; synchronized retries from many clients cause thundering-herd retry storms.
- Always cap total retries and total elapsed time; unbounded retry loops turn a blip into an outage.
- Read and close response bodies even on errors, or you leak connections from the pool.
- Don't log full request/response bodies or auth headers by default — redact secrets.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.