Skip to content

ElectronProtocolResponse

Unofficial

A response returned from a protocol handler callback.

Import:

import type { ElectronProtocolResponse } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ElectronProtocolResponse

Properties

PropertyTypeDescription
charset?stringThe charset of the response body.
data?Buffer | NodeJS.ReadableStream | stringThe response body, as a Buffer, string, or readable stream depending on the response type.
error?numberWhen assigned, the request will fail with this error number. See the net error list.
headers?Record<string, string | string[]>An object containing the response headers.
method?stringThe HTTP method. Only used for file and URL responses.
mimeType?stringThe MIME type of the response body.
path?stringPath to the file which would be sent as the response body. Only used for file responses.
referrer?stringThe referrer URL. Only used for file and URL responses.
session?SessionThe session used for requesting the URL. Setting to null uses a random independent session. Only used for URL responses.
statusCode?numberThe HTTP response code.
uploadData?ElectronProtocolResponseUploadDataThe data used as upload data. Only used for URL responses when method is POST.
url?stringDownload the URL and pipe the result as the response body. Only used for URL responses.