Skip to content

requestUrlStream

Requests a URL and returns its body as a stream.

On desktop the request goes through node:http / node:https, so the body streams as it arrives, an abort really cancels the request, and redirects are followed. On mobile it falls back to requestUrl, and the whole body arrives as a single chunk.

Import:

import { requestUrlStream } from '@mnaoumov/obsidian-lib/request-url';

Signature:

function requestUrlStream(params: RequestUrlExParams): Promise<RequestUrlStreamResponse>

Parameters:

Parameter Type Description
params RequestUrlExParams The request.

Returns: Promise<RequestUrlStreamResponse> — The response, with a streamed body.


Links to this page: