JsFetchOptions class

Network access for JS fetch. Passing this to JsWebApis enables the global fetch and installs the modules it requires. This object, not the module set, is the network policy: see allowUrl.

Constructors

JsFetchOptions({bool allowUrl(Uri url)?, JsFetchHandler? handler, int maxResponseBytes = kDefaultJsMemoryLimit, int maxRedirects = 20, Duration? connectionTimeout})
const

Properties

allowUrl bool Function(Uri url)?
Called for the request URL and for every redirect hop. Returning false fails the fetch with a TypeError. null allows every http:/https: URL, which is rarely what untrusted scripts should get.
final
connectionTimeout Duration?
final
handler JsFetchHandler?
Network implementation. null uses a HttpClient owned by the runtime and closed when the engine is disposed or reset.
final
hashCode int
The hash code for this object.
no setterinherited
maxRedirects int
final
maxResponseBytes int
Maximum response body bytes; the body stream errors past it. 0 = unlimited.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited