Fetch.functions.fetchBlob
Function: fetchBlob()
Section titled “Function: fetchBlob()”fetchBlob(
request):Effect<Blob,MalformedBlobError|FetchError|AbortError|NotAllowedError|NotOkError,Fetch>
Defined in: packages/fx-fetch/src/Fetch/fetchBlob.ts:36
Fetches and reads a blob response.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Effect<Blob, MalformedBlobError | FetchError | AbortError | NotAllowedError | NotOkError, Fetch>
0.1.0
Example
Section titled “Example”import { Effect } from 'effect';import { Fetch, Request, Response } from 'fx-fetch';
// ┌─── Effect.Effect<// │ void,// │ | Fetch.FetchError// │ | Fetch.AbortError// │ | Fetch.NotAllowedError// │ | Response.NotOkError// │ | MalformedBlobError,// │ Fetch.Fetch// │ >// ▼const program = Effect.gen(function* () { const request = Request.unsafeMake({ url: './my-endpoint' });
// ┌─── Blob // ▼ const payload = yield* Fetch.fetchBlob(request);});