Interface OngoingResponse

interface OngoingResponse {
    body: OngoingBody;
    id: string;
    tags: string[];
    timingEvents: TimingEvents;
    getHeaders(): Headers;
    getRawHeaders(): RawHeaders;
    getRawTrailers(): RawHeaders;
}

Hierarchy

  • ServerResponse
    • OngoingResponse

Properties

id: string
tags: string[]
timingEvents: TimingEvents

Methods

  • Returns a shallow copy of the current outgoing headers. Since a shallow copy is used, array values may be mutated without additional calls to various header-related HTTP module methods. The keys of the returned object are the header names and the values are the respective header values. All header names are lowercase.

    The object returned by the outgoingMessage.getHeaders() method does not prototypically inherit from the JavaScript Object. This means that typical Object methods such as obj.toString(), obj.hasOwnProperty(), and others are not defined and will not work.

    outgoingMessage.setHeader('Foo', 'bar');
    outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);

    const headers = outgoingMessage.getHeaders();
    // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }

    Returns Headers

    v7.7.0