Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HTTPClient

A HTTP client.

Hierarchy

  • DisposableBase
    • HTTPClient

Implements

  • Disposable

Index

Constructors

constructor

Properties

Protected _DISPOSABLES

_DISPOSABLES: vscode.Disposable[]

Stores disposable sub objects.

Protected _INTERVALS

_INTERVALS: Timer[]

Stores intervals.

Protected _TIMEOUTS

_TIMEOUTS: Timer[]

Stores timeouts.

Private _body

_body: any

Private _headers

_headers: any

Private _method

_method: any

Private _noResult

_noResult: boolean = false

Private _onDidSend

_onDidSend: OnDidSendListener[]

Private _query

_query: any

Private _rejectUnauthorized

_rejectUnauthorized: boolean = false

Private _timeout

_timeout: any

Private _url

_url: any

Optional cancelToken

cancelToken: vscode.CancellationToken

data

The data.

isDisposed

isDisposed: boolean

Gets if object has been disposed or not.

isDisposing

isDisposing: boolean

Gets if the 'dispose()' method is currently executed or not.

isInFinalizeState

isInFinalizeState: boolean

Gets if the object is disposed or currently disposing.

request

request: IHTTPRequest

The request.

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

body

  • Gets or sets the custom value for the body.

    Parameters

    • Optional newValue: any

    Returns HTTPClientValue<Buffer>

Protected cleanupIntervals

  • cleanupIntervals(): void
  • Cleansup all timeouts.

    Returns void

Protected cleanupTimeouts

  • cleanupTimeouts(): void
  • Cleansup all timeouts.

    Returns void

dispose

  • dispose(): void
  • inheritdoc

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

header

  • Gets or sets the custom headers.

    Parameters

    • Optional name: string
    • Optional newValue: any

    Returns HTTPClientValue<any>

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

method

noResult

  • noResult(newValue?: any): boolean | this
  • Gets or sets if a result should be shown or not.

    Parameters

    • Optional newValue: any

    Returns boolean | this

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

onDidSend

  • Adds an event listener that is invoked AFTER a request has been send.

    Parameters

    Returns this

Protected onDispose

  • onDispose(): void
  • Additional logic for the 'dispose()' method.

    Returns void

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

param

  • Gets or sets the custom query parameter(s).

    Parameters

    • Optional name: string
    • Optional newValue: any

    Returns HTTPClientValue<any>

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

rejectUnauthorized

  • rejectUnauthorized(newValue?: any): boolean | this
  • Gets or sets the 'rejectUnauthorized' for secure HTTP requests.

    Parameters

    • Optional newValue: any

    Returns boolean | this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

send

  • Sends the request based on the current data.

    Parameters

    • Optional token: vscode.CancellationToken

    Returns Promise<SendHTTPRequestResult>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setupFromActiveWorkspace

  • setupFromActiveWorkspace(): this
  • Sets up settings from active workspace.

    Returns this

    this

timeout

unsetAll

  • unsetAll(): this
  • Unsets all custom values.

    Returns this

unsetBody

  • unsetBody(): this
  • Unsets the custom body.

    Returns this

unsetHeaders

  • unsetHeaders(): this
  • Unsets the custom headers.

    Returns this

unsetMethod

  • unsetMethod(): this
  • Unsets the custom HTTP method.

    Returns this

unsetOnDidSendListeners

  • unsetOnDidSendListeners(): this
  • Unsets all 'onDidSend' listeners.

    Returns this

unsetParams

  • unsetParams(): this
  • Unsets the custom query parameters.

    Returns this

unsetTimeout

  • unsetTimeout(): this
  • Unsets the custom timeout.

    Returns this

unsetUrl

  • unsetUrl(): this
  • Unsets the custom url.

    Returns this

url

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc