An HTTP client built on fetch with automatic retries and error handling.
private
readonly
config: ResolvedConfig
delete(path: string,options?: RequestOptions,): Task<ResponseResult, HttpError>
Make a DELETE request.
get(path: string,options?: RequestOptions,): Task<ResponseResult, HttpError>
Make a GET request.
patch(): Task<ResponseResult, HttpError>
Make a PATCH request with a body.
post(): Task<ResponseResult, HttpError>
Make a POST request with a body.
put(): Task<ResponseResult, HttpError>
Make a PUT request with a body.
request(): Task<ResponseResult, HttpError>
Make an HTTP request with the specified method.
withBaseUrl(url: string | URL): WebClient
Returns a new WebClient with the given base URL.
Returns a new WebClient using the given fetch function.
withHeaders(headers: Record<string, string>): WebClient
Returns a new WebClient with the given headers merged into existing ones.
withRetry(retry: RetryOptions): WebClient
Returns a new WebClient with retry options field-merged into existing ones.
withTimeout(ms: number): WebClient
Returns a new WebClient with the given timeout in milliseconds.