Defined in: http.ts:33
optionalbody?:HttpRequestBody
Defined in: http.ts:36
optionalheaders?:Record<string,string>
Defined in: http.ts:35
optionalmethod?:string
Defined in: http.ts:34
optionalresponseType?:"text"|"json"|"binary"
Defined in: http.ts:40
"text" (default) | "json" | "binary". Streaming stays fetchStream().
optionaltimeoutMs?:number
Defined in: http.ts:38
Abort the request after N milliseconds.
Defined in: http.ts:8
optionalbinary?:Uint8Array<ArrayBufferLike>
Defined in: http.ts:23
Present when responseType:"binary" (bytes).
body:
string
Defined in: http.ts:12
headers:
Record<string,string>
Defined in: http.ts:11
optionaljson?:unknown
Defined in: http.ts:21
Present when responseType:"json".
ok:
boolean
Defined in: http.ts:10
status:
number
Defined in: http.ts:9
Defined in: http.ts:77
A streaming response: headers first, body chunks as they arrive.
body:
ReadableStream<Uint8Array<ArrayBufferLike>>
Defined in: http.ts:82
The response body as a byte stream (resolves progressively).
headers:
Record<string,string>
Defined in: http.ts:80
ok:
boolean
Defined in: http.ts:79
status:
number
Defined in: http.ts:78
HttpRequestBody =
string|Uint8Array|ArrayBuffer|Record<string,unknown>
Defined in: http.ts:26
consthttp:object
Defined in: http.ts:163
fetch: (
url,options) =>Promise<HttpResponse>
Performs a scoped HTTP request; throws if the URL is out of scope.
string
FetchOptions = {}
Promise<HttpResponse>
fetchStream: (
url,options) =>Promise<HttpStreamResponse>
Performs a scoped HTTP request whose body is delivered as a stream: the
returned promise resolves as soon as status + headers are available, and
body yields each network chunk (Uint8Array) as it arrives — the app
never has to buffer the whole response. Errors mid-stream reject the
body read.
string
FetchOptions = {}
Promise<HttpStreamResponse>
fetch(
url,options?):Promise<HttpResponse>
Defined in: http.ts:67
Performs a scoped HTTP request; throws if the URL is out of scope.
string
FetchOptions = {}
Promise<HttpResponse>
fetchStream(
url,options?):Promise<HttpStreamResponse>
Defined in: http.ts:101
Performs a scoped HTTP request whose body is delivered as a stream: the
returned promise resolves as soon as status + headers are available, and
body yields each network chunk (Uint8Array) as it arrives — the app
never has to buffer the whole response. Errors mid-stream reject the
body read.
string
FetchOptions = {}
Promise<HttpStreamResponse>