(path: string, init: RequestInit)
| 75 | } |
| 76 | |
| 77 | private async requestJson(path: string, init: RequestInit): Promise<Record<string, unknown>> { |
| 78 | const response = await fetch(`${this.baseUrl}${path}`, { |
| 79 | ...init, |
| 80 | headers: this.headers(), |
| 81 | }); |
| 82 | if (!response.ok) { |
| 83 | throw await runtimeApiError(response); |
| 84 | } |
| 85 | return await response.json() as Record<string, unknown>; |
| 86 | } |
| 87 | |
| 88 | private headers(): Record<string, string> { |
| 89 | return { |
no test coverage detected