We use cookies to improve your experience.

Cookie Policy
Logo of Lexmount
DocsTemplatesBlogHelp Center
GitHub
Logo of LexmountLexmount Browser

Get started

Lexmount Documentation
Console guide

Browser

Web Fetch

OverviewQuick Start
Common Errors

Web Search

OverviewQuick StartSearch API

Runtime

OverviewQuickstart
Overviewfetchlexmount:env
Overviewhost.fshost.fetchhost.processhost.tcphost.http
lexmount:browser
Examples

Help and billing

Capability FAQ
ChangelogContact support
API Referencelexmount:remote

host.fetch

Make HTTP requests from a client to local, private, or public services.

host.fetch sends HTTP requests from the selected client, including to local and private services accessible to that client.

Here, host is a selected RemoteHost; see host discovery to obtain one. The module overview covers permissions and shared errors.

host.fetch(input, options?)

Function: performs DNS, TCP/TLS, and HTTP requests from the selected client. It can reach local, private-network, and public services accessible to that client.

interface RemoteHost {
  fetch(input: string | URL, options?: RemoteFetchOptions): Promise<Response>;
}
ParameterTypeRequiredDescription
inputstring / URLYesAn absolute HTTP(S) URL; Request objects and URLs containing usernames or passwords are not accepted
options.methodstringNoDefaults to GET; GET / HEAD cannot carry a body; CONNECT / TRACE / TRACK are unavailable
options.headersHeadersInitNoHeaders, a string-valued record, or an array of header pairs
options.bodystring / Uint8Array / ArrayBuffer / nullNoBuffered upload; FormData and upload streams are unsupported
options.signalAbortSignalNoCancels upload, waiting for a response, or reading its body
options.redirectRequestRedirectNofollow (default, at most 20 redirects), manual, or error

Return value: Promise<Response>; see Response for properties and body methods. Bodies stream on demand. HTTP 4xx / 5xx resolve normally; network failures reject. Consume or cancel the body.

Only listed request options are supported; other fields cause TypeError. There is no separate fetch permission switch. Cross-origin redirects remove sensitive headers such as Authorization and Cookie. Cookie Jars, caches, and application retries are not automatic. Code cannot override transport headers such as Host and Content-Length.

Active cancellation rejects with signal.reason and closes the remote response resource. It cannot undo an operation already delivered to the destination.

See remote.d.ts for type declarations.

host.fs

Read and write client files, inspect metadata, and traverse directories.

host.process

Query client processes, run commands, and control streaming child processes.

Table of Contents

host.fetch(input, options?)

Still need help?Ask on Discord