Fetch


How to use the Fetch class of the bit Butil?

Usage
The Fetch class wraps the browser's Fetch API with progress reporting and an abortable handle. Prefer HttpClient for normal API calls; reach for this when you need progress for big downloads or fetch-only semantics. Inject it and use it like this:
@inject Bit.Butil.Fetch fetch

@code {
    var response = await fetch.Send(new FetchRequest { Url = "https://..." },
        onProgress: p => { /* bytes received */ });
}
Methods
Send:
Sends the request and returns the full FetchResponse (status, headers and body bytes).



Send with progress and cancellation:
Pass an onProgress callback to watch bytes arrive, and a CancellationToken to abort mid-flight.