@types/request

  • Version 2.48.5
  • Published
  • 19.3 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);

        property pass

        pass?: string;

          property password

          password?: string;

            property sendImmediately

            sendImmediately?: boolean;

              property user

              user?: string;

                property username

                username?: string;

                  interface AWSOptions

                  interface AWSOptions {}

                    property bucket

                    bucket?: string;

                      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?: any
                              ) => void;

                                interface CoreOptions

                                interface CoreOptions {}

                                  property agent

                                  agent?: http.Agent | https.Agent;

                                    property agentClass

                                    agentClass?: any;

                                      property agentOptions

                                      agentOptions?: http.AgentOptions | https.AgentOptions;

                                        property auth

                                        auth?: AuthOptions;

                                          property aws

                                          aws?: AWSOptions;

                                            property baseUrl

                                            baseUrl?: string;

                                              property body

                                              body?: any;

                                                property ca

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

                                                  property callback

                                                  callback?: RequestCallback;

                                                    property cert

                                                    cert?: Buffer;

                                                      property encoding

                                                      encoding?: string | null;

                                                        property family

                                                        family?: 4 | 6;

                                                          property followAllRedirects

                                                          followAllRedirects?: boolean;

                                                            property followOriginalHttpMethod

                                                            followOriginalHttpMethod?: boolean;

                                                              property followRedirect

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

                                                                property forever

                                                                forever?: any;

                                                                  property form

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

                                                                    property formData

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

                                                                      property gzip

                                                                      gzip?: boolean;

                                                                        property har

                                                                        har?: HttpArchiveRequest;

                                                                          property hawk

                                                                          hawk?: HawkOptions;

                                                                            property headers

                                                                            headers?: Headers;

                                                                              property host

                                                                              host?: string;

                                                                                property jar

                                                                                jar?: CookieJar | boolean;

                                                                                  property json

                                                                                  json?: any;

                                                                                    property jsonReplacer

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

                                                                                      property jsonReviver

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

                                                                                        property key

                                                                                        key?: Buffer;

                                                                                          property localAddress

                                                                                          localAddress?: string;

                                                                                            property maxRedirects

                                                                                            maxRedirects?: number;

                                                                                              property method

                                                                                              method?: string;

                                                                                                property multipart

                                                                                                multipart?: RequestPart[] | Multipart;

                                                                                                  property oauth

                                                                                                  oauth?: OAuthOptions;

                                                                                                    property passphrase

                                                                                                    passphrase?: string;

                                                                                                      property pool

                                                                                                      pool?: PoolOptions;

                                                                                                        property port

                                                                                                        port?: number;

                                                                                                          property postambleCRLF

                                                                                                          postambleCRLF?: boolean;

                                                                                                            property preambleCRLF

                                                                                                            preambleCRLF?: boolean;

                                                                                                              property proxy

                                                                                                              proxy?: any;

                                                                                                                property qs

                                                                                                                qs?: any;

                                                                                                                  property qsParseOptions

                                                                                                                  qsParseOptions?: any;

                                                                                                                    property qsStringifyOptions

                                                                                                                    qsStringifyOptions?: any;

                                                                                                                      property rejectUnauthorized

                                                                                                                      rejectUnauthorized?: boolean;

                                                                                                                        property removeRefererHeader

                                                                                                                        removeRefererHeader?: boolean;

                                                                                                                          property strictSSL

                                                                                                                          strictSSL?: boolean;

                                                                                                                            property time

                                                                                                                            time?: boolean;

                                                                                                                              property timeout

                                                                                                                              timeout?: number;

                                                                                                                                property tunnel

                                                                                                                                tunnel?: boolean;

                                                                                                                                  property useQuerystring

                                                                                                                                  useQuerystring?: boolean;

                                                                                                                                    property withCredentials

                                                                                                                                    withCredentials?: boolean;

                                                                                                                                      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;

                                                                                                                                                              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[];

                                                                                                                                                                          property method

                                                                                                                                                                          method?: string;

                                                                                                                                                                            property postData

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

                                                                                                                                                                              property url

                                                                                                                                                                              url?: string;

                                                                                                                                                                                interface Multipart

                                                                                                                                                                                interface Multipart {}

                                                                                                                                                                                  property chunked

                                                                                                                                                                                  chunked?: boolean;

                                                                                                                                                                                    property data

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

                                                                                                                                                                                      interface NameValuePair

                                                                                                                                                                                      interface NameValuePair {}

                                                                                                                                                                                        property name

                                                                                                                                                                                        name: string;

                                                                                                                                                                                          property value

                                                                                                                                                                                          value: string;

                                                                                                                                                                                            interface OAuthOptions

                                                                                                                                                                                            interface OAuthOptions {}

                                                                                                                                                                                              property body_hash

                                                                                                                                                                                              body_hash?: true | string;

                                                                                                                                                                                                property callback

                                                                                                                                                                                                callback?: string;

                                                                                                                                                                                                  property consumer_key

                                                                                                                                                                                                  consumer_key?: string;

                                                                                                                                                                                                    property consumer_secret

                                                                                                                                                                                                    consumer_secret?: string;

                                                                                                                                                                                                      property token

                                                                                                                                                                                                      token?: string;

                                                                                                                                                                                                        property token_secret

                                                                                                                                                                                                        token_secret?: string;

                                                                                                                                                                                                          property transport_method

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

                                                                                                                                                                                                            property verifier

                                                                                                                                                                                                            verifier?: string;

                                                                                                                                                                                                              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[];

                                                                                                                                                                                                                      property callback

                                                                                                                                                                                                                      callback?: RequestCallback;

                                                                                                                                                                                                                        property cert

                                                                                                                                                                                                                        cert?: Buffer;

                                                                                                                                                                                                                          property dests

                                                                                                                                                                                                                          dests: stream.Readable[];

                                                                                                                                                                                                                            property elapsedTime

                                                                                                                                                                                                                            elapsedTime?: number;

                                                                                                                                                                                                                              property encoding

                                                                                                                                                                                                                              encoding?: string | null;

                                                                                                                                                                                                                                property explicitMethod

                                                                                                                                                                                                                                explicitMethod?: true;

                                                                                                                                                                                                                                  property followAllRedirects

                                                                                                                                                                                                                                  followAllRedirects?: boolean;

                                                                                                                                                                                                                                    property followOriginalHttpMethod

                                                                                                                                                                                                                                    followOriginalHttpMethod?: boolean;

                                                                                                                                                                                                                                      property gzip

                                                                                                                                                                                                                                      gzip?: boolean;

                                                                                                                                                                                                                                        property har

                                                                                                                                                                                                                                        har?: HttpArchiveRequest;

                                                                                                                                                                                                                                          property headers

                                                                                                                                                                                                                                          headers: Headers;

                                                                                                                                                                                                                                            property host

                                                                                                                                                                                                                                            host?: string;

                                                                                                                                                                                                                                              property href

                                                                                                                                                                                                                                              href: string;

                                                                                                                                                                                                                                                property key

                                                                                                                                                                                                                                                key?: Buffer;

                                                                                                                                                                                                                                                  property localAddress

                                                                                                                                                                                                                                                  localAddress?: string;

                                                                                                                                                                                                                                                    property maxRedirects

                                                                                                                                                                                                                                                    maxRedirects?: number;

                                                                                                                                                                                                                                                      property method

                                                                                                                                                                                                                                                      method: string;

                                                                                                                                                                                                                                                        property passphrase

                                                                                                                                                                                                                                                        passphrase?: string;

                                                                                                                                                                                                                                                          property path

                                                                                                                                                                                                                                                          path: string;

                                                                                                                                                                                                                                                            property pool

                                                                                                                                                                                                                                                            pool: PoolOptions;

                                                                                                                                                                                                                                                              property port

                                                                                                                                                                                                                                                              port?: number;

                                                                                                                                                                                                                                                                property postambleCRLF

                                                                                                                                                                                                                                                                postambleCRLF?: boolean;

                                                                                                                                                                                                                                                                  property preambleCRLF

                                                                                                                                                                                                                                                                  preambleCRLF?: boolean;

                                                                                                                                                                                                                                                                    property proxy

                                                                                                                                                                                                                                                                    proxy: null | string | Url;

                                                                                                                                                                                                                                                                      property readable

                                                                                                                                                                                                                                                                      readable: boolean;

                                                                                                                                                                                                                                                                        property rejectUnauthorized

                                                                                                                                                                                                                                                                        rejectUnauthorized?: boolean;

                                                                                                                                                                                                                                                                          property removeRefererHeader

                                                                                                                                                                                                                                                                          removeRefererHeader?: boolean;

                                                                                                                                                                                                                                                                            property response

                                                                                                                                                                                                                                                                            response?: Response;

                                                                                                                                                                                                                                                                              property setHost

                                                                                                                                                                                                                                                                              setHost: boolean;

                                                                                                                                                                                                                                                                                property src

                                                                                                                                                                                                                                                                                src?: stream.Readable;

                                                                                                                                                                                                                                                                                  property startTime

                                                                                                                                                                                                                                                                                  startTime?: number;

                                                                                                                                                                                                                                                                                    property startTimeNow

                                                                                                                                                                                                                                                                                    startTimeNow?: number;

                                                                                                                                                                                                                                                                                      property strictSSL

                                                                                                                                                                                                                                                                                      strictSSL?: boolean;

                                                                                                                                                                                                                                                                                        property time

                                                                                                                                                                                                                                                                                        time?: boolean;

                                                                                                                                                                                                                                                                                          property timeout

                                                                                                                                                                                                                                                                                          timeout?: number;

                                                                                                                                                                                                                                                                                            property timing

                                                                                                                                                                                                                                                                                            timing?: boolean;

                                                                                                                                                                                                                                                                                              property timings

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

                                                                                                                                                                                                                                                                                                property tunnel

                                                                                                                                                                                                                                                                                                tunnel: boolean;

                                                                                                                                                                                                                                                                                                  property uri

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

                                                                                                                                                                                                                                                                                                    property withCredentials

                                                                                                                                                                                                                                                                                                    withCredentials?: boolean;

                                                                                                                                                                                                                                                                                                      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): void;
                                                                                                                                                                                                                                                                                                                  (chunk: any, cb?: () => void): void;
                                                                                                                                                                                                                                                                                                                  (str: string, encoding?: string, cb?: () => void): void;
                                                                                                                                                                                                                                                                                                                  };

                                                                                                                                                                                                                                                                                                                    method form

                                                                                                                                                                                                                                                                                                                    form: { (): any; (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: any) => 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: any) => void): this;
                                                                                                                                                                                                                                                                                                                                (event: 'socket', listener: (src: any) => 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;

                                                                                                                                                                                                                                                                                                                                                                                              interface Response

                                                                                                                                                                                                                                                                                                                                                                                              interface Response extends http.IncomingMessage {}

                                                                                                                                                                                                                                                                                                                                                                                                property body

                                                                                                                                                                                                                                                                                                                                                                                                body: any;

                                                                                                                                                                                                                                                                                                                                                                                                  property caseless

                                                                                                                                                                                                                                                                                                                                                                                                  caseless: caseless.Caseless;

                                                                                                                                                                                                                                                                                                                                                                                                    property elapsedTime

                                                                                                                                                                                                                                                                                                                                                                                                    elapsedTime?: number;

                                                                                                                                                                                                                                                                                                                                                                                                      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;
                                                                                                                                                                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                                                                                                                                                                              property timings

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

                                                                                                                                                                                                                                                                                                                                                                                                                property timingStart

                                                                                                                                                                                                                                                                                                                                                                                                                timingStart?: number;

                                                                                                                                                                                                                                                                                                                                                                                                                  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>