class HttpFetcher
implements IContentFetcher

Fetches content over HTTP/HTTPS using the standard Fetch API. This is the default fetcher for URL-based sources.

Constructors

new
HttpFetcher(options?: IHttpFetcherOptions)

Creates a new HttpFetcher

Properties

private
readonly
headers: Record<string, string>
private
readonly
options: Required<Omit<IHttpFetcherOptions, "headers">>

Methods

canHandle(source: string): boolean

Checks if this fetcher can handle the given source.

fetch(source: string): Promise<string>

Fetches content from a URL.

Usage

import { HttpFetcher } from ".";