Dynamic module request

Index

Functions

Functions

RequestAPI(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

RequestAPI(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

RequestAPI(options: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options: Options
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

initParams: any

AWSOptions: AWSOptions

optional public bucket?: string

public secret: string

AuthOptions: AuthOptions

optional public pass?: string

optional public password?: string

optional public sendImmediately?: boolean

optional public user?: string

optional public username?: string

Cookie: Cookie

(n: number): T in Array<T>

Parameters

  • n: number

Returns

T in Array<T>

public expires: Date

public length: number

Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.

public path: string

public str: string

public concat(items?: Array<U extends T[]>): Array<T>

Combines two or more arrays.

Parameters

  • items?: Array<U extends T[]> optional

    Additional items to add to the end of array1.

Returns

Array<T>

public concat(items?: Array<T>): Array<T>

Combines two or more arrays.

Parameters

  • items?: Array<T> optional

    Additional items to add to the end of array1.

Returns

Array<T>

public constructor(name: string, req: Request)

Parameters

public every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean

Determines whether all the members of an array satisfy the specified test.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

boolean

public filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): Array<T>

Returns the elements of an array that meet the condition specified in a callback function.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

Array<T>

public forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any)

Performs the specified action for each element in an array.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => void

    A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

public indexOf(searchElement: T in Array<T>, fromIndex?: number): number

Returns the index of the first occurrence of a value in an array.

Parameters

  • searchElement: T in Array<T>

    The value to locate in the array.

  • fromIndex?: number optional

    The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

Returns

number

public join(separator?: string): string

Adds all the elements of an array separated by the specified separator string.

Parameters

  • separator?: string optional

    A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

Returns

string

public lastIndexOf(searchElement: T in Array<T>, fromIndex?: number): number

Returns the index of the last occurrence of a specified value in an array.

Parameters

  • searchElement: T in Array<T>

    The value to locate in the array.

  • fromIndex?: number optional

    The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.

Returns

number

public map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): Array<U>

Calls a defined callback function on each element of an array, and returns an array that contains the results.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => U

    A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

Array<U>

public pop(): T in Array<T>

Removes the last element from an array and returns it.

Returns

T in Array<T>

public push(items?: Array<T>): number

Appends new elements to an array, and returns the new length of the array.

Parameters

  • items?: Array<T> optional

    New elements of the Array.

Returns

number

public reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T in Array<T>): T in Array<T>

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T

    A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

  • initialValue?: T in Array<T> optional

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

T in Array<T>

public reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U

    A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

  • initialValue: U

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

U

public reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T in Array<T>): T in Array<T>

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T

    A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

  • initialValue?: T in Array<T> optional

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

T in Array<T>

public reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U

    A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

  • initialValue: U

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

U

public reverse(): Array<T>

Reverses the elements in an Array.

Returns

Array<T>

public shift(): T in Array<T>

Removes the first element from an array and returns it.

Returns

T in Array<T>

public slice(start?: number, end?: number): Array<T>

Returns a section of an array.

Parameters

  • start?: number optional

    The beginning of the specified portion of the array.

  • end?: number optional

    The end of the specified portion of the array.

Returns

Array<T>

public some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean

Determines whether the specified callback function returns true for any element of an array.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

boolean

public sort(compareFn?: (a: T, b: T) => number): Array<T>

Sorts an array.

Parameters

  • compareFn?: (a: T, b: T) => number optional

    The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.

Returns

Array<T>

public splice(start: number): Array<T>

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

  • start: number

    The zero-based location in the array from which to start removing elements.

Returns

Array<T>

public splice(start: number, deleteCount: number, items?: Array<T>): Array<T>

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

  • start: number

    The zero-based location in the array from which to start removing elements.

  • deleteCount: number

    The number of elements to remove.

  • items?: Array<T> optional

    Elements to insert into the array in place of the deleted elements.

Returns

Array<T>

public toLocaleString(): string

Returns

string

public toString(): string

Returns

string

public unshift(items?: Array<T>): number

Inserts new elements at the start of an array.

Parameters

  • items?: Array<T> optional

    Elements to insert at the start of the Array.

Returns

number

CookieJar: CookieJar

public add(cookie: Cookie)

Parameters

public cookieString(req: Request): string

Parameters

Returns

string

public get(req: Request): Cookie

Parameters

Returns

Cookie

CookieValue: CookieValue

public httpOnly: boolean

public name: string

public value: any

HawkOptions: HawkOptions

public credentials: any

Headers: Headers

(key: string): any

Parameters

  • key: string

Returns

any

OAuthOptions: OAuthOptions

optional public callback?: string

optional public consumer_key?: string

optional public consumer_secret?: string

optional public token?: string

optional public token_secret?: string

optional public verifier?: string

Options: Options

optional public agentClass?: any

optional public agentOptions?: any

optional public aws?: AWSOptions

optional public body?: any

optional public callback?: (error: any, response: any, body: any) => void

optional public encoding?: string

optional public followAllRedirects?: boolean

optional public followRedirect?: boolean

optional public forever?: any

optional public form?: FormData

optional public hawk?: HawkOptions

optional public headers?: Headers

optional public host?: string

optional public jar?: any

optional public json?: any

optional public maxRedirects?: number

optional public method?: string

optional public multipart?: RequestPart[]

optional public oauth?: OAuthOptions

optional public pool?: any

optional public port?: number

optional public proxy?: any

optional public qs?: Object

optional public strictSSL?: boolean

optional public timeout?: number

optional public uri?: string

optional public url?: string

Request: Request

public abort()

public aws(opts: AWSOptions, now?: boolean): Request

Parameters

Returns

Request

public destroy()

public end(chunk: string)

Parameters

  • chunk: string

public end(chunk: NodeBuffer)

Parameters

public form(): FormData

Returns

FormData

public form(form: any): Request

Parameters

  • form: any

Returns

Request

public getAgent(): Agent

Returns

Agent

public jar(jar: CookieJar): Request

Parameters

Returns

Request

public json(val: any): Request

Parameters

  • val: any

Returns

Request

public multipart(multipart: RequestPart[]): Request

Parameters

Returns

Request

public oauth(oauth: OAuthOptions): Request

Parameters

Returns

Request

public pause()

public pipe(dest: Writable, opts?: any): Writable

Parameters

Returns

Writable

public pipeDest(dest: any)

Parameters

  • dest: any

public qs(q: Object, clobber?: boolean): Request

Parameters

  • q: Object
  • clobber?: boolean optional

Returns

Request

public resume()

public setHeader(name: string, value: string, clobber?: boolean): Request

Parameters

  • name: string
  • value: string
  • clobber?: boolean optional

Returns

Request

public setHeaders(headers: Headers): Request

Parameters

Returns

Request

public toJSON(): string

Returns

string

public write()

RequestPart: RequestPart

public body: any

optional public headers?: Headers

cookie(str: string): Cookie

Parameters

  • str: string

Returns

Cookie

defaults(options: Options): RequestAPI

Parameters

Returns

RequestAPI

del(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

del(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

del(options: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options: Options
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

forever(agentOptions: any, optionsArg: any): Request

Parameters

  • agentOptions: any
  • optionsArg: any

Returns

Request

get(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

get(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

get(options: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options: Options
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

head(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

head(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

head(options: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options: Options
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

jar(): CookieJar

Returns

CookieJar

patch(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

patch(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

patch(options: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options: Options
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

post(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

post(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

post(options: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options: Options
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

put(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

put(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

put(options: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options: Options
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

request(uri: string, options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

request(uri: string, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • uri: string
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request

request(options?: Options, callback?: (error: any, response: any, body: any) => void): Request

Parameters

  • options?: Options optional
  • callback?: (error: any, response: any, body: any) => void optional

Returns

Request