MCPcopy Create free account
hub / github.com/Effect-TS/effect / get

Function get

packages/effect/test/httpapi/HttpApiClient.test.ts:229–238  ·  view source on GitHub ↗
(api: HttpApi.HttpApi<"Api", typeof Group>, status: number)

Source from the content-addressed store, hash-verified

227 }).annotate(HttpApi.ParseOptions, Strict)
228 )
229 const get = (api: HttpApi.HttpApi<"Api", typeof Group>, status: number) =>
230 HttpApiClient.makeWith(api, {
231 baseUrl: "http://test",
232 httpClient: clientFromResponse(() =>
233 new Response(JSON.stringify(adaWithExtra), {
234 status,
235 headers: { "content-type": "application/json", "server": "test", "x-count": "1" }
236 })
237 )
238 }).pipe(Effect.flatMap((client) => Effect.exit(client.test.get({}))))
239
240 let api = HttpApi.make("Api").add(Group).annotate(HttpApi.SuccessParseOptions, {})
241 const headersError = yield* get(api, 200)

Callers 1

Calls 4

clientFromResponseFunction · 0.85
exitMethod · 0.80
pipeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected