ElectronProtocolResponse
Unofficial
A response returned from a protocol handler callback.
Import:
import type { ElectronProtocolResponse } from '@obsidian-typings/obsidian-catalyst-latest';Signature:
export interface ElectronProtocolResponseProperties
| Property | Type | Description | |
|---|---|---|---|
| charset? | string | The charset of the response body. | |
| data? | Buffer | NodeJS.ReadableStream | string | The response body, as a Buffer, string, or readable stream depending on the response type. | |
| error? | number | When 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? | string | The HTTP method. Only used for file and URL responses. | |
| mimeType? | string | The MIME type of the response body. | |
| path? | string | Path to the file which would be sent as the response body. Only used for file responses. | |
| referrer? | string | The referrer URL. Only used for file and URL responses. | |
| session? | Session | The session used for requesting the URL. Setting to null uses a random independent session. Only used for URL responses. | |
| statusCode? | number | The HTTP response code. | |
| uploadData? | ElectronProtocolResponseUploadData | The data used as upload data. Only used for URL responses when method is POST. | |
| url? | string | Download the URL and pipe the result as the response body. Only used for URL responses. |