Skip to content

Request.functions.readBytes

fx-fetch


fx-fetch / Request / readBytes

readBytes(self): Effect<Uint8Array<ArrayBuffer>, MalformedBytesError, never>

Defined in: packages/fx-fetch/src/Request/readBytes.ts:23

Reads the body of a Request as Bytes.

Request

Effect<Uint8Array<ArrayBuffer>, MalformedBytesError, never>

import { Request } from 'fx-fetch';
import { Effect } from 'effect';
const request = Request.make({ url: 'https://api.example.com', method: 'POST' });
const bytes = await Effect.runPromise(Request.readBytes(request));

0.1.0