(url: URL)
| 83 | HttpClientRequest.get(url).pipe(HttpClientRequest.setHeaders(headers(format, userAgent))) |
| 84 | |
| 85 | const assertHttpUrl = (url: URL) => { |
| 86 | if (url.protocol !== "http:" && url.protocol !== "https:") throw new Error("URL must use http:// or https://") |
| 87 | } |
| 88 | |
| 89 | const execute = (http: HttpClient.HttpClient, url: string, format: Format, userAgent = browserUserAgent) => |
| 90 | http.execute(request(url, format, userAgent)).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk)) |