Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Agent<ReqRaw, ResParsed>

Agent acts as an HTTP client.

An Agent instance uses its transport to send HTTP requests and receive responses.

Type parameters

  • ReqRaw

  • ResParsed

Hierarchy

  • Agent

Index

Constructors

constructor

Properties

cookies

cookies: Container

headers

host

host: Host

options

options: Options

plugins

plugins: Plugin<ReqRaw, ResParsed>[]

transport

transport: Transport<ReqRaw, ResParsed>

Methods

delete

get

head

patch

post

put

send

setTransport

  • setTransport<Req, Res>(transport: Transport<Req, Res>, plugins?: Plugin<Req, Res>[]): Agent<Req, Res>
  • setTransport allows the transport to be changed (possibly to process a different type of response).

    A new Agent instance is created with NO plugins installed.

    Type parameters

    • Req

    • Res

    Parameters

    • transport: Transport<Req, Res>
    • Default value plugins: Plugin<Req, Res>[] = []

    Returns Agent<Req, Res>

Generated using TypeDoc