| 189 | } |
| 190 | const requests: Array<{ readonly url: string; readonly headers: Record<string, string> }> = [] |
| 191 | const create = (api: HttpApi.HttpApi<"Api", typeof Group>) => |
| 192 | HttpApiClient.makeWith(api, { |
| 193 | baseUrl: "http://test", |
| 194 | httpClient: HttpClient.make((request, url) => |
| 195 | Effect.sync(() => { |
| 196 | requests.push({ url: url.toString(), headers: request.headers }) |
| 197 | return HttpClientResponse.fromWeb(request, new Response(null, { status: 204 })) |
| 198 | }) |
| 199 | ) |
| 200 | }).pipe(Effect.flatMap((client) => Effect.exit(client.test.create(request))), Effect.map(String)) |
| 201 | |
| 202 | // Encoded in order: params, payload, headers, query. |
| 203 | let api = HttpApi.make("Api").add(Group) |