@types/request

  • Version 2.48.12
  • Published
  • 19.8 kB
  • 4 dependencies
  • MIT license

Install

npm i @types/request
yarn add @types/request
pnpm add @types/request

Overview

TypeScript definitions for request

Index

Variables

Interfaces

Type Aliases

Variables

variable request

var request: request.RequestAPI<
request.Request,
request.CoreOptions,
request.RequiredUriUrl
>;

    Interfaces

    interface AuthOptions

    interface AuthOptions {}

      property bearer

      bearer?: string | (() => string) | undefined;

        property pass

        pass?: string | undefined;

          property password

          password?: string | undefined;

            property sendImmediately

            sendImmediately?: boolean | undefined;

              property user

              user?: string | undefined;

                property username

                username?: string | undefined;

                  interface AWSOptions

                  interface AWSOptions {}

                    property bucket

                    bucket?: string | undefined;

                      property secret

                      secret: string;

                        interface CookieJar

                        interface CookieJar {}

                          method getCookies

                          getCookies: (uri: string | Url) => Cookie[];

                            method getCookieString

                            getCookieString: (uri: string | Url) => string;

                              method setCookie

                              setCookie: (
                              cookieOrStr: Cookie | string,
                              uri: string | Url,
                              options?: tough.CookieJar.SetCookieOptions
                              ) => void;

                                interface CoreOptions

                                interface CoreOptions {}

                                  property agent

                                  agent?: http.Agent | https.Agent | undefined;

                                    property agentClass

                                    agentClass?: any;

                                      property agentOptions

                                      agentOptions?: http.AgentOptions | https.AgentOptions | undefined;

                                        property auth

                                        auth?: AuthOptions | undefined;

                                          property aws

                                          aws?: AWSOptions | undefined;

                                            property baseUrl

                                            baseUrl?: string | undefined;

                                              property body

                                              body?: any;

                                                property ca

                                                ca?: string | Buffer | string[] | Buffer[] | undefined;

                                                  property callback

                                                  callback?: RequestCallback | undefined;

                                                    property cert

                                                    cert?: Buffer | undefined;

                                                      property encoding

                                                      encoding?: string | null | undefined;

                                                        property family

                                                        family?: 4 | 6 | undefined;

                                                          property followAllRedirects

                                                          followAllRedirects?: boolean | undefined;

                                                            property followOriginalHttpMethod

                                                            followOriginalHttpMethod?: boolean | undefined;

                                                              property followRedirect

                                                              followRedirect?:
                                                              | boolean
                                                              | ((response: http.IncomingMessage) => boolean)
                                                              | undefined;

                                                                property forever

                                                                forever?: any;

                                                                  property form

                                                                  form?: { [key: string]: any } | string | undefined;

                                                                    property formData

                                                                    formData?: { [key: string]: any } | undefined;

                                                                      property gzip

                                                                      gzip?: boolean | undefined;

                                                                        property har

                                                                        har?: HttpArchiveRequest | undefined;

                                                                          property hawk

                                                                          hawk?: HawkOptions | undefined;

                                                                            property headers

                                                                            headers?: Headers | undefined;

                                                                              property host

                                                                              host?: string | undefined;

                                                                                property jar

                                                                                jar?: CookieJar | boolean | undefined;

                                                                                  property json

                                                                                  json?: any;

                                                                                    property jsonReplacer

                                                                                    jsonReplacer?: ((key: string, value: any) => any) | undefined;

                                                                                      property jsonReviver

                                                                                      jsonReviver?: ((key: string, value: any) => any) | undefined;

                                                                                        property key

                                                                                        key?: Buffer | undefined;

                                                                                          property localAddress

                                                                                          localAddress?: string | undefined;

                                                                                            property maxRedirects

                                                                                            maxRedirects?: number | undefined;

                                                                                              property method

                                                                                              method?: string | undefined;

                                                                                                property multipart

                                                                                                multipart?: RequestPart[] | Multipart | undefined;

                                                                                                  property oauth

                                                                                                  oauth?: OAuthOptions | undefined;

                                                                                                    property passphrase

                                                                                                    passphrase?: string | undefined;

                                                                                                      property pool

                                                                                                      pool?: PoolOptions | undefined;

                                                                                                        property port

                                                                                                        port?: number | undefined;

                                                                                                          property postambleCRLF

                                                                                                          postambleCRLF?: boolean | undefined;

                                                                                                            property preambleCRLF

                                                                                                            preambleCRLF?: boolean | undefined;

                                                                                                              property proxy

                                                                                                              proxy?: any;

                                                                                                                property qs

                                                                                                                qs?: any;

                                                                                                                  property qsParseOptions

                                                                                                                  qsParseOptions?: any;

                                                                                                                    property qsStringifyOptions

                                                                                                                    qsStringifyOptions?: any;

                                                                                                                      property rejectUnauthorized

                                                                                                                      rejectUnauthorized?: boolean | undefined;

                                                                                                                        property removeRefererHeader

                                                                                                                        removeRefererHeader?: boolean | undefined;

                                                                                                                          property strictSSL

                                                                                                                          strictSSL?: boolean | undefined;

                                                                                                                            property time

                                                                                                                            time?: boolean | undefined;

                                                                                                                              property timeout

                                                                                                                              timeout?: number | undefined;

                                                                                                                                property tunnel

                                                                                                                                tunnel?: boolean | undefined;

                                                                                                                                  property useQuerystring

                                                                                                                                  useQuerystring?: boolean | undefined;

                                                                                                                                    property withCredentials

                                                                                                                                    withCredentials?: boolean | undefined;

                                                                                                                                      interface DefaultUriUrlRequestApi

                                                                                                                                      interface DefaultUriUrlRequestApi<
                                                                                                                                      TRequest extends Request,
                                                                                                                                      TOptions extends CoreOptions,
                                                                                                                                      TUriUrlOptions
                                                                                                                                      > extends RequestAPI<TRequest, TOptions, TUriUrlOptions> {}

                                                                                                                                        method defaults

                                                                                                                                        defaults: (
                                                                                                                                        options: TOptions
                                                                                                                                        ) => DefaultUriUrlRequestApi<TRequest, TOptions, OptionalUriUrl>;

                                                                                                                                          method del

                                                                                                                                          del: {
                                                                                                                                          (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                          (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                          (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                          (callback?: RequestCallback): TRequest;
                                                                                                                                          };

                                                                                                                                            method delete

                                                                                                                                            delete: {
                                                                                                                                            (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                            (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                            (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                            (callback?: RequestCallback): TRequest;
                                                                                                                                            };

                                                                                                                                              method get

                                                                                                                                              get: {
                                                                                                                                              (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                              (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                              (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                              (callback?: RequestCallback): TRequest;
                                                                                                                                              };

                                                                                                                                                method head

                                                                                                                                                head: {
                                                                                                                                                (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                (callback?: RequestCallback): TRequest;
                                                                                                                                                };

                                                                                                                                                  method patch

                                                                                                                                                  patch: {
                                                                                                                                                  (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                  (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                  (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                  (callback?: RequestCallback): TRequest;
                                                                                                                                                  };

                                                                                                                                                    method post

                                                                                                                                                    post: {
                                                                                                                                                    (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                    (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                    (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                    (callback?: RequestCallback): TRequest;
                                                                                                                                                    };

                                                                                                                                                      method put

                                                                                                                                                      put: {
                                                                                                                                                      (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                      (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                      (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                      (callback?: RequestCallback): TRequest;
                                                                                                                                                      };

                                                                                                                                                        call signature

                                                                                                                                                        (callback?: RequestCallback): TRequest;

                                                                                                                                                          interface ExtraPoolOptions

                                                                                                                                                          interface ExtraPoolOptions {}

                                                                                                                                                            property maxSockets

                                                                                                                                                            maxSockets?: number | undefined;

                                                                                                                                                              interface HawkOptions

                                                                                                                                                              interface HawkOptions {}

                                                                                                                                                                property credentials

                                                                                                                                                                credentials: any;

                                                                                                                                                                  interface Headers

                                                                                                                                                                  interface Headers {}

                                                                                                                                                                    index signature

                                                                                                                                                                    [key: string]: any;

                                                                                                                                                                      interface HttpArchiveRequest

                                                                                                                                                                      interface HttpArchiveRequest {}

                                                                                                                                                                        property headers

                                                                                                                                                                        headers?: NameValuePair[] | undefined;

                                                                                                                                                                          property method

                                                                                                                                                                          method?: string | undefined;

                                                                                                                                                                            property postData

                                                                                                                                                                            postData?:
                                                                                                                                                                            | {
                                                                                                                                                                            mimeType?: string | undefined;
                                                                                                                                                                            params?: NameValuePair[] | undefined;
                                                                                                                                                                            }
                                                                                                                                                                            | undefined;

                                                                                                                                                                              property url

                                                                                                                                                                              url?: string | undefined;

                                                                                                                                                                                interface Multipart

                                                                                                                                                                                interface Multipart {}

                                                                                                                                                                                  property chunked

                                                                                                                                                                                  chunked?: boolean | undefined;

                                                                                                                                                                                    property data

                                                                                                                                                                                    data?:
                                                                                                                                                                                    | Array<{
                                                                                                                                                                                    'content-type'?: string | undefined;
                                                                                                                                                                                    body: MultipartBody;
                                                                                                                                                                                    }>
                                                                                                                                                                                    | undefined;

                                                                                                                                                                                      interface NameValuePair

                                                                                                                                                                                      interface NameValuePair {}

                                                                                                                                                                                        property name

                                                                                                                                                                                        name: string;

                                                                                                                                                                                          property value

                                                                                                                                                                                          value: string;

                                                                                                                                                                                            interface OAuthOptions

                                                                                                                                                                                            interface OAuthOptions {}

                                                                                                                                                                                              property body_hash

                                                                                                                                                                                              body_hash?: true | string | undefined;

                                                                                                                                                                                                property callback

                                                                                                                                                                                                callback?: string | undefined;

                                                                                                                                                                                                  property consumer_key

                                                                                                                                                                                                  consumer_key?: string | undefined;

                                                                                                                                                                                                    property consumer_secret

                                                                                                                                                                                                    consumer_secret?: string | undefined;

                                                                                                                                                                                                      property token

                                                                                                                                                                                                      token?: string | undefined;

                                                                                                                                                                                                        property token_secret

                                                                                                                                                                                                        token_secret?: string | undefined;

                                                                                                                                                                                                          property transport_method

                                                                                                                                                                                                          transport_method?: 'body' | 'header' | 'query' | undefined;

                                                                                                                                                                                                            property verifier

                                                                                                                                                                                                            verifier?: string | undefined;

                                                                                                                                                                                                              interface Request

                                                                                                                                                                                                              interface Request extends caseless.Httpified, stream.Stream {}

                                                                                                                                                                                                                property agent

                                                                                                                                                                                                                agent: false | http.Agent | https.Agent;

                                                                                                                                                                                                                  property body

                                                                                                                                                                                                                  body: Buffer | Buffer[] | string | string[] | stream.Readable;

                                                                                                                                                                                                                    property ca

                                                                                                                                                                                                                    ca?: string | Buffer | string[] | Buffer[] | undefined;

                                                                                                                                                                                                                      property callback

                                                                                                                                                                                                                      callback?: RequestCallback | undefined;

                                                                                                                                                                                                                        property cert

                                                                                                                                                                                                                        cert?: Buffer | undefined;

                                                                                                                                                                                                                          property dests

                                                                                                                                                                                                                          dests: stream.Readable[];

                                                                                                                                                                                                                            property elapsedTime

                                                                                                                                                                                                                            elapsedTime?: number | undefined;

                                                                                                                                                                                                                              property encoding

                                                                                                                                                                                                                              encoding?: string | null | undefined;

                                                                                                                                                                                                                                property explicitMethod

                                                                                                                                                                                                                                explicitMethod?: true | undefined;

                                                                                                                                                                                                                                  property followAllRedirects

                                                                                                                                                                                                                                  followAllRedirects?: boolean | undefined;

                                                                                                                                                                                                                                    property followOriginalHttpMethod

                                                                                                                                                                                                                                    followOriginalHttpMethod?: boolean | undefined;

                                                                                                                                                                                                                                      property gzip

                                                                                                                                                                                                                                      gzip?: boolean | undefined;

                                                                                                                                                                                                                                        property har

                                                                                                                                                                                                                                        har?: HttpArchiveRequest | undefined;

                                                                                                                                                                                                                                          property headers

                                                                                                                                                                                                                                          headers: Headers;

                                                                                                                                                                                                                                            property host

                                                                                                                                                                                                                                            host?: string | undefined;

                                                                                                                                                                                                                                              property href

                                                                                                                                                                                                                                              href: string;

                                                                                                                                                                                                                                                property key

                                                                                                                                                                                                                                                key?: Buffer | undefined;

                                                                                                                                                                                                                                                  property localAddress

                                                                                                                                                                                                                                                  localAddress?: string | undefined;

                                                                                                                                                                                                                                                    property maxRedirects

                                                                                                                                                                                                                                                    maxRedirects?: number | undefined;

                                                                                                                                                                                                                                                      property method

                                                                                                                                                                                                                                                      method: string;

                                                                                                                                                                                                                                                        property passphrase

                                                                                                                                                                                                                                                        passphrase?: string | undefined;

                                                                                                                                                                                                                                                          property path

                                                                                                                                                                                                                                                          path: string;

                                                                                                                                                                                                                                                            property pool

                                                                                                                                                                                                                                                            pool: PoolOptions;

                                                                                                                                                                                                                                                              property port

                                                                                                                                                                                                                                                              port?: number | undefined;

                                                                                                                                                                                                                                                                property postambleCRLF

                                                                                                                                                                                                                                                                postambleCRLF?: boolean | undefined;

                                                                                                                                                                                                                                                                  property preambleCRLF

                                                                                                                                                                                                                                                                  preambleCRLF?: boolean | undefined;

                                                                                                                                                                                                                                                                    property proxy

                                                                                                                                                                                                                                                                    proxy: null | string | Url;

                                                                                                                                                                                                                                                                      property readable

                                                                                                                                                                                                                                                                      readable: boolean;

                                                                                                                                                                                                                                                                        property rejectUnauthorized

                                                                                                                                                                                                                                                                        rejectUnauthorized?: boolean | undefined;

                                                                                                                                                                                                                                                                          property removeRefererHeader

                                                                                                                                                                                                                                                                          removeRefererHeader?: boolean | undefined;

                                                                                                                                                                                                                                                                            property response

                                                                                                                                                                                                                                                                            response?: Response | undefined;

                                                                                                                                                                                                                                                                              property setHost

                                                                                                                                                                                                                                                                              setHost: boolean;

                                                                                                                                                                                                                                                                                property src

                                                                                                                                                                                                                                                                                src?: stream.Readable | undefined;

                                                                                                                                                                                                                                                                                  property startTime

                                                                                                                                                                                                                                                                                  startTime?: number | undefined;

                                                                                                                                                                                                                                                                                    property startTimeNow

                                                                                                                                                                                                                                                                                    startTimeNow?: number | undefined;

                                                                                                                                                                                                                                                                                      property strictSSL

                                                                                                                                                                                                                                                                                      strictSSL?: boolean | undefined;

                                                                                                                                                                                                                                                                                        property time

                                                                                                                                                                                                                                                                                        time?: boolean | undefined;

                                                                                                                                                                                                                                                                                          property timeout

                                                                                                                                                                                                                                                                                          timeout?: number | undefined;

                                                                                                                                                                                                                                                                                            property timing

                                                                                                                                                                                                                                                                                            timing?: boolean | undefined;

                                                                                                                                                                                                                                                                                              property timings

                                                                                                                                                                                                                                                                                              timings?:
                                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                              socket: number;
                                                                                                                                                                                                                                                                                              lookup: number;
                                                                                                                                                                                                                                                                                              connect: number;
                                                                                                                                                                                                                                                                                              response: number;
                                                                                                                                                                                                                                                                                              end: number;
                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                              | undefined;

                                                                                                                                                                                                                                                                                                property tunnel

                                                                                                                                                                                                                                                                                                tunnel: boolean;

                                                                                                                                                                                                                                                                                                  property uri

                                                                                                                                                                                                                                                                                                  uri: Url & { href: string; pathname: string };

                                                                                                                                                                                                                                                                                                    property withCredentials

                                                                                                                                                                                                                                                                                                    withCredentials?: boolean | undefined;

                                                                                                                                                                                                                                                                                                      property writable

                                                                                                                                                                                                                                                                                                      writable: boolean;

                                                                                                                                                                                                                                                                                                        method abort

                                                                                                                                                                                                                                                                                                        abort: () => void;

                                                                                                                                                                                                                                                                                                          method auth

                                                                                                                                                                                                                                                                                                          auth: (
                                                                                                                                                                                                                                                                                                          username: string,
                                                                                                                                                                                                                                                                                                          password: string,
                                                                                                                                                                                                                                                                                                          sendImmediately?: boolean,
                                                                                                                                                                                                                                                                                                          bearer?: string
                                                                                                                                                                                                                                                                                                          ) => Request;

                                                                                                                                                                                                                                                                                                            method aws

                                                                                                                                                                                                                                                                                                            aws: (opts: AWSOptions, now?: boolean) => Request;

                                                                                                                                                                                                                                                                                                              method debug

                                                                                                                                                                                                                                                                                                              debug: (...args: any[]) => void;

                                                                                                                                                                                                                                                                                                                method destroy

                                                                                                                                                                                                                                                                                                                destroy: () => void;

                                                                                                                                                                                                                                                                                                                  method end

                                                                                                                                                                                                                                                                                                                  end: {
                                                                                                                                                                                                                                                                                                                  (cb?: () => void): any;
                                                                                                                                                                                                                                                                                                                  (chunk: any, cb?: () => void): any;
                                                                                                                                                                                                                                                                                                                  (str: string, encoding?: string, cb?: () => void): any;
                                                                                                                                                                                                                                                                                                                  };

                                                                                                                                                                                                                                                                                                                    method form

                                                                                                                                                                                                                                                                                                                    form: { (): FormData; (form: any): Request };

                                                                                                                                                                                                                                                                                                                      method hawk

                                                                                                                                                                                                                                                                                                                      hawk: (opts: HawkOptions) => void;

                                                                                                                                                                                                                                                                                                                        method jar

                                                                                                                                                                                                                                                                                                                        jar: (jar: CookieJar) => Request;

                                                                                                                                                                                                                                                                                                                          method json

                                                                                                                                                                                                                                                                                                                          json: (val: any) => Request;

                                                                                                                                                                                                                                                                                                                            method multipart

                                                                                                                                                                                                                                                                                                                            multipart: (multipart: RequestPart[]) => Request;

                                                                                                                                                                                                                                                                                                                              method oauth

                                                                                                                                                                                                                                                                                                                              oauth: (oauth: OAuthOptions) => Request;

                                                                                                                                                                                                                                                                                                                                method on

                                                                                                                                                                                                                                                                                                                                on: {
                                                                                                                                                                                                                                                                                                                                (event: string, listener: (...args: any[]) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'request', listener: (req: http.ClientRequest) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'response', listener: (resp: Response) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'data', listener: (data: any) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'error', listener: (e: Error) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'complete', listener: (resp: Response, body?: any) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'pipe', listener: (src: stream.Readable) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'socket', listener: (src: net.Socket) => void): this;
                                                                                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                                                                                  method pause

                                                                                                                                                                                                                                                                                                                                  pause: () => void;

                                                                                                                                                                                                                                                                                                                                    method pipeDest

                                                                                                                                                                                                                                                                                                                                    pipeDest: (dest: any) => void;

                                                                                                                                                                                                                                                                                                                                      method qs

                                                                                                                                                                                                                                                                                                                                      qs: (q: object, clobber?: boolean) => Request;

                                                                                                                                                                                                                                                                                                                                        method resume

                                                                                                                                                                                                                                                                                                                                        resume: () => void;

                                                                                                                                                                                                                                                                                                                                          method toJSON

                                                                                                                                                                                                                                                                                                                                          toJSON: () => RequestAsJSON;

                                                                                                                                                                                                                                                                                                                                            method write

                                                                                                                                                                                                                                                                                                                                            write: {
                                                                                                                                                                                                                                                                                                                                            (buffer: Buffer | string, cb?: (err?: Error) => void): boolean;
                                                                                                                                                                                                                                                                                                                                            (str: string, encoding?: string, cb?: (err?: Error) => void): boolean;
                                                                                                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                                                                                                              interface RequestAPI

                                                                                                                                                                                                                                                                                                                                              interface RequestAPI<
                                                                                                                                                                                                                                                                                                                                              TRequest extends Request,
                                                                                                                                                                                                                                                                                                                                              TOptions extends CoreOptions,
                                                                                                                                                                                                                                                                                                                                              TUriUrlOptions
                                                                                                                                                                                                                                                                                                                                              > {}

                                                                                                                                                                                                                                                                                                                                                property debug

                                                                                                                                                                                                                                                                                                                                                debug: boolean;

                                                                                                                                                                                                                                                                                                                                                  method cookie

                                                                                                                                                                                                                                                                                                                                                  cookie: (str: string) => Cookie | undefined;

                                                                                                                                                                                                                                                                                                                                                    method defaults

                                                                                                                                                                                                                                                                                                                                                    defaults: {
                                                                                                                                                                                                                                                                                                                                                    (options: TOptions): RequestAPI<TRequest, TOptions, RequiredUriUrl>;
                                                                                                                                                                                                                                                                                                                                                    (options: RequiredUriUrl & TOptions): DefaultUriUrlRequestApi<
                                                                                                                                                                                                                                                                                                                                                    TRequest,
                                                                                                                                                                                                                                                                                                                                                    TOptions,
                                                                                                                                                                                                                                                                                                                                                    OptionalUriUrl
                                                                                                                                                                                                                                                                                                                                                    >;
                                                                                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                                                                                      method del

                                                                                                                                                                                                                                                                                                                                                      del: {
                                                                                                                                                                                                                                                                                                                                                      (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                      (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                      (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                                                                        method delete

                                                                                                                                                                                                                                                                                                                                                        delete: {
                                                                                                                                                                                                                                                                                                                                                        (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                        (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                        (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                                                                                                          method forever

                                                                                                                                                                                                                                                                                                                                                          forever: (agentOptions: any, optionsArg: any) => TRequest;

                                                                                                                                                                                                                                                                                                                                                            method get

                                                                                                                                                                                                                                                                                                                                                            get: {
                                                                                                                                                                                                                                                                                                                                                            (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                            (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                            (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                                                                                                                              method head

                                                                                                                                                                                                                                                                                                                                                              head: {
                                                                                                                                                                                                                                                                                                                                                              (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                              (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                              (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                                                                                                                                method initParams

                                                                                                                                                                                                                                                                                                                                                                initParams: {
                                                                                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                                                                                uri: string,
                                                                                                                                                                                                                                                                                                                                                                options?: TOptions,
                                                                                                                                                                                                                                                                                                                                                                callback?: RequestCallback
                                                                                                                                                                                                                                                                                                                                                                ): RequiredUriUrl & TOptions;
                                                                                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                                                                                uriOrOpts: string | (RequiredUriUrl & TOptions),
                                                                                                                                                                                                                                                                                                                                                                callback?: RequestCallback
                                                                                                                                                                                                                                                                                                                                                                ): RequiredUriUrl & TOptions;
                                                                                                                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                                                                                                                  method jar

                                                                                                                                                                                                                                                                                                                                                                  jar: (store?: any) => CookieJar;

                                                                                                                                                                                                                                                                                                                                                                    method patch

                                                                                                                                                                                                                                                                                                                                                                    patch: {
                                                                                                                                                                                                                                                                                                                                                                    (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                    (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                    (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                                                                                                      method post

                                                                                                                                                                                                                                                                                                                                                                      post: {
                                                                                                                                                                                                                                                                                                                                                                      (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                      (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                      (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                                                                                        method put

                                                                                                                                                                                                                                                                                                                                                                        put: {
                                                                                                                                                                                                                                                                                                                                                                        (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                        (uri: string, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                        (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;
                                                                                                                                                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                                                                                                                                                          call signature

                                                                                                                                                                                                                                                                                                                                                                          (uri: string, options?: TOptions, callback?: RequestCallback): TRequest;

                                                                                                                                                                                                                                                                                                                                                                            call signature

                                                                                                                                                                                                                                                                                                                                                                            (uri: string, callback?: RequestCallback): TRequest;

                                                                                                                                                                                                                                                                                                                                                                              call signature

                                                                                                                                                                                                                                                                                                                                                                              (options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest;

                                                                                                                                                                                                                                                                                                                                                                                interface RequestAsJSON

                                                                                                                                                                                                                                                                                                                                                                                interface RequestAsJSON {}

                                                                                                                                                                                                                                                                                                                                                                                  property headers

                                                                                                                                                                                                                                                                                                                                                                                  headers: Headers;

                                                                                                                                                                                                                                                                                                                                                                                    property method

                                                                                                                                                                                                                                                                                                                                                                                    method: string;

                                                                                                                                                                                                                                                                                                                                                                                      property uri

                                                                                                                                                                                                                                                                                                                                                                                      uri: Url;

                                                                                                                                                                                                                                                                                                                                                                                        interface RequestPart

                                                                                                                                                                                                                                                                                                                                                                                        interface RequestPart {}

                                                                                                                                                                                                                                                                                                                                                                                          property body

                                                                                                                                                                                                                                                                                                                                                                                          body: any;

                                                                                                                                                                                                                                                                                                                                                                                            property headers

                                                                                                                                                                                                                                                                                                                                                                                            headers?: Headers | undefined;

                                                                                                                                                                                                                                                                                                                                                                                              interface Response

                                                                                                                                                                                                                                                                                                                                                                                              interface Response extends http.IncomingMessage {}

                                                                                                                                                                                                                                                                                                                                                                                                property body

                                                                                                                                                                                                                                                                                                                                                                                                body: any;

                                                                                                                                                                                                                                                                                                                                                                                                  property caseless

                                                                                                                                                                                                                                                                                                                                                                                                  caseless: caseless.Caseless;

                                                                                                                                                                                                                                                                                                                                                                                                    property elapsedTime

                                                                                                                                                                                                                                                                                                                                                                                                    elapsedTime?: number | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                      property request

                                                                                                                                                                                                                                                                                                                                                                                                      request: Request;

                                                                                                                                                                                                                                                                                                                                                                                                        property statusCode

                                                                                                                                                                                                                                                                                                                                                                                                        statusCode: number;

                                                                                                                                                                                                                                                                                                                                                                                                          property statusMessage

                                                                                                                                                                                                                                                                                                                                                                                                          statusMessage: string;

                                                                                                                                                                                                                                                                                                                                                                                                            property timingPhases

                                                                                                                                                                                                                                                                                                                                                                                                            timingPhases?:
                                                                                                                                                                                                                                                                                                                                                                                                            | {
                                                                                                                                                                                                                                                                                                                                                                                                            wait: number;
                                                                                                                                                                                                                                                                                                                                                                                                            dns: number;
                                                                                                                                                                                                                                                                                                                                                                                                            tcp: number;
                                                                                                                                                                                                                                                                                                                                                                                                            firstByte: number;
                                                                                                                                                                                                                                                                                                                                                                                                            download: number;
                                                                                                                                                                                                                                                                                                                                                                                                            total: number;
                                                                                                                                                                                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                                                                                                                                                                                            | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                              property timings

                                                                                                                                                                                                                                                                                                                                                                                                              timings?:
                                                                                                                                                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                                                                                                                                              socket: number;
                                                                                                                                                                                                                                                                                                                                                                                                              lookup: number;
                                                                                                                                                                                                                                                                                                                                                                                                              connect: number;
                                                                                                                                                                                                                                                                                                                                                                                                              response: number;
                                                                                                                                                                                                                                                                                                                                                                                                              end: number;
                                                                                                                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                                                                                                                              | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                                property timingStart

                                                                                                                                                                                                                                                                                                                                                                                                                timingStart?: number | undefined;

                                                                                                                                                                                                                                                                                                                                                                                                                  method toJSON

                                                                                                                                                                                                                                                                                                                                                                                                                  toJSON: () => ResponseAsJSON;

                                                                                                                                                                                                                                                                                                                                                                                                                    interface ResponseAsJSON

                                                                                                                                                                                                                                                                                                                                                                                                                    interface ResponseAsJSON {}

                                                                                                                                                                                                                                                                                                                                                                                                                      property body

                                                                                                                                                                                                                                                                                                                                                                                                                      body: any;

                                                                                                                                                                                                                                                                                                                                                                                                                        property headers

                                                                                                                                                                                                                                                                                                                                                                                                                        headers: Headers;

                                                                                                                                                                                                                                                                                                                                                                                                                          property request

                                                                                                                                                                                                                                                                                                                                                                                                                          request: RequestAsJSON;

                                                                                                                                                                                                                                                                                                                                                                                                                            property statusCode

                                                                                                                                                                                                                                                                                                                                                                                                                            statusCode: number;

                                                                                                                                                                                                                                                                                                                                                                                                                              interface UriOptions

                                                                                                                                                                                                                                                                                                                                                                                                                              interface UriOptions {}

                                                                                                                                                                                                                                                                                                                                                                                                                                property uri

                                                                                                                                                                                                                                                                                                                                                                                                                                uri: string | Url;

                                                                                                                                                                                                                                                                                                                                                                                                                                  interface UrlOptions

                                                                                                                                                                                                                                                                                                                                                                                                                                  interface UrlOptions {}

                                                                                                                                                                                                                                                                                                                                                                                                                                    property url

                                                                                                                                                                                                                                                                                                                                                                                                                                    url: string | Url;

                                                                                                                                                                                                                                                                                                                                                                                                                                      Type Aliases

                                                                                                                                                                                                                                                                                                                                                                                                                                      type Cookie = tough.Cookie;

                                                                                                                                                                                                                                                                                                                                                                                                                                        type MultipartBody

                                                                                                                                                                                                                                                                                                                                                                                                                                        type MultipartBody = string | Buffer | ArrayBuffer | Uint8Array;

                                                                                                                                                                                                                                                                                                                                                                                                                                          type OptionalUriUrl

                                                                                                                                                                                                                                                                                                                                                                                                                                          type OptionalUriUrl = RequiredUriUrl | {};

                                                                                                                                                                                                                                                                                                                                                                                                                                            type Options

                                                                                                                                                                                                                                                                                                                                                                                                                                            type Options = OptionsWithUri | OptionsWithUrl;

                                                                                                                                                                                                                                                                                                                                                                                                                                              type OptionsWithUri

                                                                                                                                                                                                                                                                                                                                                                                                                                              type OptionsWithUri = UriOptions & CoreOptions;

                                                                                                                                                                                                                                                                                                                                                                                                                                                type OptionsWithUrl

                                                                                                                                                                                                                                                                                                                                                                                                                                                type OptionsWithUrl = UrlOptions & CoreOptions;

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type PoolOptions

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type PoolOptions =
                                                                                                                                                                                                                                                                                                                                                                                                                                                  | false
                                                                                                                                                                                                                                                                                                                                                                                                                                                  | ({ [key: string]: http.Agent | https.Agent } & ExtraPoolOptions)
                                                                                                                                                                                                                                                                                                                                                                                                                                                  | ExtraPoolOptions;

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type RequestCallback

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type RequestCallback = (error: any, response: Response, body: any) => void;

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type RequestResponse

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type RequestResponse = Response;

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type RequiredUriUrl

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type RequiredUriUrl = UriOptions | UrlOptions;

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ResponseRequest

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ResponseRequest = Request;

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Package Files (1)

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Dependencies (4)

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Dev Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                            No dev dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                                                            No peer dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Badge

                                                                                                                                                                                                                                                                                                                                                                                                                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/request.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/request)
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              <a href="https://www.jsdocs.io/package/@types/request"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>