dispatchLocalRequest
Nodepod API / src / http / dispatchLocalRequest
Function: dispatchLocalRequest()
Section titled “Function: dispatchLocalRequest()”dispatchLocalRequest(
port,method,path,headers,body?):Promise<CompletedResponse|null>
Defined in: src/polyfills/http.ts:1500
Deliver a request to the virtual server listening on a loopback port: the
one in this worker if it owns the port, otherwise the one another process
registered with the main thread. Resolves null when nothing listens
there (and no bridge exists), so callers can fall back to the network.
Used by the global fetch() patch so a pod command can talk to its own
dev server the way node’s fetch reaches a local socket.
Parameters
Section titled “Parameters”number
method
Section titled “method”string
string
headers
Section titled “headers”Record<string, string>
Buffer<ArrayBufferLike>
Returns
Section titled “Returns”Promise<CompletedResponse | null>