Skip to content

ElectronIncomingMessage

Unofficial

An HTTP response message returned by a ClientRequest.

Import:

import type { ElectronIncomingMessage } from '@obsidian-typings/obsidian-public-latest';

Signature:

export class ElectronIncomingMessage

Properties

Property Type Description
headers Record<string, string | string[]> A Record<string, string | string[]> representing the HTTP response headers. The headers object is formatted as follows:

- All header names are lowercased. - Duplicates of age, authorization, content-length, content-type, etag, expires, from, host, if-modified-since, if-unmodified-since, last-modified, location, max-forwards, proxy-authorization, referer, retry-after, server, or user-agent are discarded. - set-cookie is always an array. Duplicates are added to the array. - For duplicate cookie headers, the values are joined together with '; '. - For all other headers, the values are joined together with ', '.
httpVersion string A string indicating the HTTP protocol version number. Typical values are '1.0' or '1.1'. Additionally httpVersionMajor and httpVersionMinor are two Integer-valued readable properties that return respectively the HTTP major and minor version numbers.
httpVersionMajor number An Integer indicating the HTTP protocol major version number.
httpVersionMinor number An Integer indicating the HTTP protocol minor version number.
rawHeaders string[] A string[] containing the raw HTTP response headers exactly as they were received. The keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the odd-numbered offsets are the associated values. Header names are not lowercased, and duplicates are not merged.
statusCode number An Integer indicating the HTTP response status code.
statusMessage string A string representing the HTTP status message.

Methods

Method Returns Description
addListener(event, listener) this Registers a listener for the given response event.
addListener(event, listener) this
addListener(event, listener) this
addListener(event, listener) this
on('aborted', listener) this Registers a listener for the given response event.
on('data', listener) this
on('end', listener) this
on('error', listener) this
once(event, listener) this Registers a one-time listener for the given response event.
once(event, listener) this
once(event, listener) this
once(event, listener) this
removeListener(event, listener) this Removes the given listener for the given response event.
removeListener(event, listener) this
removeListener(event, listener) this
removeListener(event, listener) this