Class HttpClientStream

Represents a single http message exchange (request/response) in HTTP.

NOTE: Binding either the ready or response event will uncork any buffered events and start event delivery

Hierarchy

Properties

Methods

  • HTTP status code returned from the server.

    Returns undefined | number

    Either the status code, or undefined if the server response has not arrived yet.

  • Begin sending the request.

    The stream does nothing until this is called. Call activate() when you are ready for its callbacks and events to fire.

    Returns void

  • Forces all written events to be buffered in memory. The buffered data will be flushed when uncork is called.

    Returns void

  • Flushes all data buffered since cork was called.

    NOTE: It is HIGHLY recommended that uncorking should always be done via process.nextTick, not during the EventEmitter.on() call.

    Returns void

  • Synchronously calls each of the listeners registered for the event key supplied in registration order. If the BufferedEventEmitter is currently corked, the event will be buffered until uncork is called.

    Parameters

    • event: EventKey

      The name of the event

    • Rest ...args: any[]

      Event payload

    Returns boolean

Events

RESPONSE: string = 'response'

Emitted when the http response headers have arrived.

DATA: string = 'data'

Emitted when http response data is available.

ERROR: string = 'error'

Emitted when an error occurs in stream processing

END: string = 'end'

Emitted when the stream has completed

Generated using TypeDoc