Method
makeRequest
({
url,
options,
headers,
}: MakeRequestParams)
Source from the content-addressed store, hash-verified
| 97 | } |
| 98 | |
| 99 | private async makeRequest({ |
| 100 | url, |
| 101 | options, |
| 102 | headers, |
| 103 | }: MakeRequestParams): Promise<Response> { |
| 104 | const resp = await fetch(url, { |
| 105 | method: options.method, |
| 106 | headers, |
| 107 | body: JSON.stringify(options.body), |
| 108 | ...(this.config.timeout && { |
| 109 | signal: AbortSignal.timeout(this.config.timeout), |
| 110 | }), |
| 111 | }); |
| 112 | return resp; |
| 113 | } |
| 114 | |
| 115 | private async handleErrorResponse({ |
| 116 | response, |
Tested by
no test coverage detected