(path: string, body: unknown, opts?: RequestOptions)
| 219 | } |
| 220 | |
| 221 | async post<T>(path: string, body: unknown, opts?: RequestOptions): Promise<T> { |
| 222 | const res = await this.request(path, { |
| 223 | method: "POST", |
| 224 | body: JSON.stringify(body), |
| 225 | signal: opts?.signal, |
| 226 | extraHeaders: opts?.headers, |
| 227 | }); |
| 228 | if (!res.ok) throw await toApiError(res); |
| 229 | return res.json() as Promise<T>; |
| 230 | } |
| 231 | |
| 232 | async patch<T>(path: string, body: unknown, opts?: RequestOptions): Promise<T> { |
| 233 | const res = await this.request(path, { |
no test coverage detected