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

PropertyTypeDescription
headersRecord<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 ', '.
httpVersionstringA 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.
httpVersionMajornumberAn Integer indicating the HTTP protocol major version number.
httpVersionMinornumberAn Integer indicating the HTTP protocol minor version number.
rawHeadersstring[]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.
statusCodenumberAn Integer indicating the HTTP response status code.
statusMessagestringA string representing the HTTP status message.

Methods

MethodReturnsDescription
addListener(event, listener)thisRegisters a listener for the given response event.
addListener(event, listener)this
addListener(event, listener)this
addListener(event, listener)this
on('aborted', listener)thisRegisters a listener for the given response event.
on('data', listener)this
on('end', listener)this
on('error', listener)this
once(event, listener)thisRegisters a one-time listener for the given response event.
once(event, listener)this
once(event, listener)this
once(event, listener)this
removeListener(event, listener)thisRemoves the given listener for the given response event.
removeListener(event, listener)this
removeListener(event, listener)this
removeListener(event, listener)this