Options
All
  • Public
  • Public/Protected
  • All
Menu

hanif-tiny-http

Index

Type aliases

OmittedResponse

OmittedResponse: Omit<Response, "addData">

RequestMethod

RequestMethod: "GET" | "POST" | "PUT" | "DELETE" | "OPTIONS"

TinyHttpBase

TinyHttpBase: { agent?: http.Agent; baseURL: string; headers?: Record<string, string> }

Type declaration

  • Optional agent?: http.Agent
  • baseURL: string
  • Optional headers?: Record<string, string>

TinyHttpOptions

TinyHttpOptions: Omit<TinyHttpBase, "baseURL"> & { content?: string; json?: Record<string, unknown>; maxRedirects?: number; method?: RequestMethod; stream?: boolean; timeout?: number } & http.RequestOptions & https.RequestOptions

Variables

tinyHttp

tinyHttp: TinyHttpClient = ...

Simple HTTP Client

Functions

Const getPureRequest

  • getPureRequest(url: string | URL, options?: TinyHttpOptions, handleResponse?: (res: IncomingMessage) => void, callbackReq?: (req: ClientRequest) => void): void
  • Pure HTTP Client Request

    Parameters

    • url: string | URL

      An URL want to send request

    • options: TinyHttpOptions = ...

      Client HTTP Options

    • Optional handleResponse: (res: IncomingMessage) => void

      A callback could handle your response.

        • (res: IncomingMessage): void
        • Parameters

          • res: IncomingMessage

          Returns void

    • Optional callbackReq: (req: ClientRequest) => void
        • (req: ClientRequest): void
        • Parameters

          • req: ClientRequest

          Returns void

    Returns void

Generated using TypeDoc