effect-http-client

Build outgoing HTTP clients in Effect with retries, rate limiting, cookies, and schema-decoded responses.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-http-client-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-http-client
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-http-client
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-http-client-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect, @effect/platform-node.

What problem does it solve? Making outbound HTTP calls in Effect v4 requires knowing the unstable effect/unstable/http API surface — immutable request builders, effectful body combinators, the HttpClientError taxonomy, and transport layers — which differs significantly from v3's @effect/platform packages and changes between betas. ## Core Features & Use Cases - Configured API clients: Derive immutable clients with mapRequest, filterStatusOk, retryTransient, and transformResponse to wrap an upstream API in a typed service. - Schema-validated I/O: Encode request bodies with schemaBodyJson and decode responses with HttpClientResponse.schemaBodyJson, matchStatus, and schemaHeaders. - Resilience and control: Apply retryTransient for 408/429/5xx, withRateLimiter with RateLimiter, cookie jars via withCookiesRef, redirect following, tracing controls, and streaming uploads/downloads. - Use Case: Build a Todos service that prepends a base URL, attaches a bearer token, retries transient failures with exponential backoff, decodes JSON responses into Schema classes, and is mocked in tests with HttpClient.make. ## Quick Start Ask the assistant to write an Effect service that calls a REST API using HttpClient with schema-decoded responses, transient retries, and a mock transport for tests.

Frequently Asked Questions about effect-http-client

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make HTTP requests with Effect v4 HttpClient?

Provide a transport layer such as FetchHttpClient.layer or NodeHttpClient.layerUndici, then access the HttpClient.HttpClient service and call methods like client.get or client.post. Responses expose effectful body getters like response.json and response.text.

How do I retry failed HTTP requests in Effect?

Use HttpClient.retryTransient, which retries transient statuses (408, 429, 500, 502, 503, 504), TransportError, and TimeoutError with an optional Schedule and times cap. For custom logic, HttpClient.retry accepts the same options as Effect.retry.

Does Effect v4 still use @effect/platform for the HTTP client?

No. In v4 the HTTP client lives in the effect package under effect/unstable/http. Only platform transports like NodeHttpClient and BunHttpClient remain in @effect/platform-node and @effect/platform-bun.

How do I decode HTTP response JSON with a Schema in Effect?

Pass your schema to HttpClientResponse.schemaBodyJson and flatMap it over the request effect. Decoding failures surface as SchemaError, and you can also use matchStatus to handle different status codes with different decoders.

How do I mock HttpClient in Effect tests?

Build a mock with HttpClient.make, returning HttpClientResponse.fromWeb(request, new Response(...)), then provide it via Layer.succeed(HttpClient.HttpClient, mockClient). You can route by request to simulate failures and count retry attempts.

Why does my Effect HTTP client not fail on 404 or 500 responses?

By default any status is a success. Apply HttpClient.filterStatusOk at the client level to turn non-2xx responses into StatusCodeError failures, or use HttpClientResponse.filterStatusOk for a single request.