fetch_api
JavaScript bindings for Fetch API, flexible HTTP requests, redirects, streaming and more.
2.3.1
76K downloads/mo
#1245 most downloaded on pub.dev
Zekfad/fetch_api
What this package is like to depend on
Last release 1 years ago
24 Apr 2025
Ships unpredictably
gaps range from 9 days to 10 months
Nearly every release is documented
notes for 9 of 9 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
15 releases · first in 2023
0 releases in the last 12 months
see the full history below
Release timeline
15 releases · Jan 2023 to Apr 2025Releases
latest 15-
2.3.124 Apr 2025Release notes
Open source →- Fix lint errors.
- Use
package:zekfad_lints/lib.yamlwhich aligns with core lints.
Release notes
Open source →- Fix lint errors.
- Use
package:zekfad_lints/lib.yamlwhich aligns with core lints.
-
2.3.028 Mar 2025Release notes
Open source →Requires Dart 3.6
- Use proper JS type checks.
- Add missing docs to public API.
- Add missing
FileandJSDataViewtoRequestBodyunion. - Add missing
JSDataViewtoResponseBodyunion. - Update license years.
ReadableStreamSourceCancelMethodFunctionreturnsJSPromiseOr, because this
method can return synchronously.- Fix
ReadableStreamSource.fromStreamcancel after error (#6) - Add
canStreamRequestsfunction to check if streaming is supported in
current browser.
Release notes
Open source →Requires Dart 3.6
- Use proper JS type checks.
- Add missing docs to public API.
- Add missing
FileandJSDataViewtoRequestBodyunion. - Add missing
JSDataViewtoResponseBodyunion. - Update license years.
ReadableStreamSourceCancelMethodFunctionreturnsJSPromiseOr, because this method can return synchronously.- Fix
ReadableStreamSource.fromStreamcancel after error (#6) - Add
canStreamRequestsfunction to check if streaming is supported in current browsers.
-
2.2.026 May 2024Release notes
Open source →2.2.0
Current usage is mostly limited to
package:fetch_clientand these changes
restores WASM support, therefore no major version bump was made.- BREAKING
ReadableStreamDefaultReader.readAsStreamis now generic as
in actual stream. - BREAKING
ReadableStream.fromTypedDataStreamnow have 2 generic
parametersT extends TypedDataandAbortType extends JSAnyinstead of
singleAbortType.
Method itself now always returnsReadableStream<JSUint8Array, AbortType>,
this means that anyTypedDatais re-viewed to beUint8List. - BREAKING
RequestBodyandResponseBodynow constructable only from
JS types:- Removed
fromByteBufferinstead addedfromJSArrayBuffer. - Removed
fromTypedDatainstead addedfromJSTypedArray. - Removed
fromStringinstead addedfromJSString. fromReadableStreamtightened type toReadableStream<JSUint8Array, JSAny>
because fetch supports only streams ofUint8Arrays.
- Removed
- BREAKING Fixed typo
RequestDestination.sharedworkerto
RequestDestination.sharedWorker. - Fixed
ResponseandRequestnot working in WASM: this happened due to JS
runtime being more lax in type assertions, namelyJSStringasStringis
ok in JS runtime, but fails in WASM. ResponseandRequestnow uses precise type
ReadableStream<JSUint8Array, JSAny>
2.1.0
- Add
package:fetch_api/enums.dartfetch_api.enumspackage with enumerations
available to all platforms (including VM). - Use
DOMExceptionfrompackage:webinstead of alias toJSObject. - Enumerations use
if (dart.library.io) ''for documentation-only imports,
this allows to use them in non-JS environments.
2.0.0
- BREAKING: migrate to
package:webwith WASM support. - Full rewrite to use
extension types - no moreInstanceMembers. - Internal JS Iterators are now fully covered with generics.
- JS Iterator is no longer exported via public API.
Headersuses(String, String)in entries instead ofList<String>.FetchOptionsandRequestOptionsare now inherited fromRequestInit
and interchangeable.ReadableStreamSourcestart,pullandcancelare now only callable
via JS interop, as they require binding to parent object.
1.0.3
- Remove type from
IteratorInstanceMembersto support old language
version.
Technically this is a breaking, andIteratorResultfalls back todynamic
now, but it isn't exposed via public API and wrapper still works the same.
Release notes
Open source →Current usage is mostly limited to
package:fetch_clientand these changes restores WASM support, therefore no major version bump was made.- BREAKING
ReadableStreamDefaultReader.readAsStreamis now generic as in actual stream. - BREAKING
ReadableStream.fromTypedDataStreamnow have 2 generic parametersT extends TypedDataandAbortType extends JSAnyinstead of singleAbortType. Method itself now always returnsReadableStream<JSUint8Array, AbortType>, this means that anyTypedDatais re-viewed to beUint8List. - BREAKING
RequestBodyandResponseBodynow constructible only from JS types:- Removed
fromByteBufferinstead addedfromJSArrayBuffer. - Removed
fromTypedDatainstead addedfromJSTypedArray. - Removed
fromStringinstead addedfromJSString. fromReadableStreamtightened type toReadableStream<JSUint8Array, JSAny>because fetch supports only streams ofUint8Arrays.
- Removed
- BREAKING Fixed typo
RequestDestination.sharedworkertoRequestDestination.sharedWorker. - Fixed
ResponseandRequestnot working in WASM: this happened due to JS runtime being more lax in type assertions, namelyJSStringasStringis ok in JS runtime, but fails in WASM. ResponseandRequestnow use precise typeReadableStream<JSUint8Array, JSAny>
- BREAKING
-
2.1.004 May 2024Release notes
Open source →- Add
package:fetch_api/enums.dartfetch_api.enumspackage with enumerations available for all platforms (including VM). - Use
DOMExceptionfrompackage:webinstead of alias toJSObject. - Enumerations use
if (dart.library.io) ''for documentation-only imports, this allows to use them in non-JS environments.
- Add
-
2.0.015 Apr 2024Release notes
Open source →- BREAKING: migrate to
package:webwith WASM support. - Full rewrite to use
extension types - no moreInstanceMembers. - Internal JS Iterators are now fully covered with generics.
- JS Iterator is no longer exported via public API.
Headersnow use(String, String)in entries instead ofList<String>.FetchOptionsandRequestOptionsare now inherited fromRequestInitand interchangeable.ReadableStreamSourcestart,pullandcancelare now only callable via JS interop, as they require binding to parent object.
- BREAKING: migrate to
-
2.0.0-wasm08 Feb 2024 pre-releaseNothing published for this version
-
1.0.330 Oct 2023Release notes
Open source →- Remove type from
IteratorInstanceMembersto support old language version. Technically this is a breaking, andIteratorResultfalls back todynamicnow, but it isn't exposed via public API and wrapper still works the same.
- Remove type from
-
1.0.206 Oct 2023 -
1.0.112 Mar 2023 -
1.0.023 Feb 2023 -
1.0.0-dev.513 Feb 2023 pre-releaseRelease notes
Open source →- BREAKING: Renamed
RequestInittoFetchOptions.
This is done to make emphasis, thatfetchandRequesthave different
(default) behaviors. - Added
Request. - Added
RequestDuplex. This adds support for request streaming in supported
browsers. - Added
ReadableStreamSource. This allows you to create custom
ReadableStreams, that is required for request streaming. - Added
ReadableStreamDefaultController. - Added
ReadableStreamSourceclass that helps you to create custom source
forReadableStreams. It can be created from Dart'sStream. - Added
RequestCache. - Added
RequestDestination. - Added missing options to
RequestModeand added docs. - Added
FetchOptionsandRequestOptionswith corresponding docs from MDN. - Compatibility layer:
- BREAKING: Renamed
createRequestInittocreateFetchOptions - Added
createRequestOptions. - Added
createReadableStream. - Added
createReadableStreamSourceFromStream.
- BREAKING: Renamed
- Fixed dev dependencies versions, to allow running on Dart 2.19.
Release notes
Open source →- BREAKING: Renamed
RequestInittoFetchOptions. This is done to make emphatic, thatfetchandRequesthave different (default) behaviors. - Added
Request. - Added
RequestDuplex. This adds support for request streaming in supported browsers. - Added
ReadableStreamSource. This allows you to create customReadableStreams, that is required for request streaming. - Added
ReadableStreamDefaultController. - Added
ReadableStreamSourceclass that helps you to create custom source forReadableStreams. It can be created from Dart'sStream. - Added
RequestCache. - Added
RequestDestination. - Added missing options to
RequestModeand added docs. - Added
FetchOptionsandRequestOptionswith corresponding docs from MDN. - Compatibility layer:
- BREAKING: Renamed
createRequestInittocreateFetchOptions - Added
createRequestOptions. - Added
createReadableStream. - Added
createReadableStreamSourceFromStream.
- BREAKING: Renamed
- Fixed dev dependency versions, to allow running on Dart 2.19.
- BREAKING: Renamed
-
1.0.0-dev.423 Jan 2023 pre-release -
1.0.0-dev.323 Jan 2023 pre-releaseRelease notes
Open source →- BREAKING: Renamed extensions from
<Class>Extensionto<Class>InstanceMembers. - Added
fetch_api.compatibility_layerlibrary to support Dart 2.19.- Added
createHeadersFromMap - Added
createHeadersFromArray - Added
createRequestInit - Added
createAbortSignalTimeout
- Added
Release notes
Open source →-
BREAKING: Renamed extensions from
<Class>Extensionto<Class>InstanceMembers. -
Added
fetch_api.compatibility_layerlibrary to support Dart 2.19.- Added
createHeadersFromMap - Added
createHeadersFromArray - Added
createRequestInit - Added
createAbortSignalTimeout
- Added
-
AbortSignal- Added
timeoutconstructor-like method. - Added
abortconstructor-like method. - Added
abortedproperty. - Added
reasonproperty. - Added
throwIfAbortedmethod.
- Added
-
AbortController- Added docs.
-
fetch()added docs. -
Response- Fixed internal definition for
_formDatamethod. - Added docs.
- Fixed internal definition for
-
Headers- Added docs.
-
IteratorandIteratorResult- Added docs.
-
ReadableStreamDefaultReaderandReadableStreamDefaultReaderChunk- Added docs.
- BREAKING: Renamed extensions from
-
1.0.0-dev.222 Jan 2023 pre-release -
1.0.0-dev.122 Jan 2023 pre-release