Skip to content

@pumpkin-plugins/port-mapping API / http / httpRequest

Function: httpRequest() ​

httpRequest(net, to, request, timeoutMs?): Steps<HttpResponse>

Defined in: tools/port-mapping/src/http.ts:32

Makes one HTTP/1.1 request and reads the whole response. Routers answer small XML documents, so this stays small: no redirects, no keep-alive, no TLS.

Parameters ​

net ​

Network

to ​

Endpoint

request ​

HttpRequest

timeoutMs? ​

number = 5000

How long the whole exchange may take.

Returns ​

Steps<HttpResponse>

Throws ​

When the connection can't be made or breaks, or the answer isn't HTTP.

Pumpkin Plugins documentation