PackageTrack
Sign in Get early access

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 2025
2024 2025 2026
Release Pre-release

Releases

latest 15
  1. 2.3.1 24 Apr 2025
    Release notes
    • Fix lint errors.
    • Use package:zekfad_lints/lib.yaml which aligns with core lints.
    Open source →
    Release notes
    • Fix lint errors.
    • Use package:zekfad_lints/lib.yaml which aligns with core lints.
    Open source →
  2. 2.3.0 28 Mar 2025
    Release notes

    Requires Dart 3.6

    • Use proper JS type checks.
    • Add missing docs to public API.
    • Add missing File and JSDataView to RequestBody union.
    • Add missing JSDataView to ResponseBody union.
    • Update license years.
    • ReadableStreamSourceCancelMethodFunction returns JSPromiseOr, because this
      method can return synchronously.
    • Fix ReadableStreamSource.fromStream cancel after error (#6)
    • Add canStreamRequests function to check if streaming is supported in
      current browser.
    Open source →
    Release notes

    Requires Dart 3.6

    • Use proper JS type checks.
    • Add missing docs to public API.
    • Add missing File and JSDataView to RequestBody union.
    • Add missing JSDataView to ResponseBody union.
    • Update license years.
    • ReadableStreamSourceCancelMethodFunction returns JSPromiseOr, because this method can return synchronously.
    • Fix ReadableStreamSource.fromStream cancel after error (#6)
    • Add canStreamRequests function to check if streaming is supported in current browsers.
    Open source →
  3. 2.2.0 26 May 2024
    Release notes

    2.2.0

    Current usage is mostly limited to package:fetch_client and these changes
    restores WASM support, therefore no major version bump was made.

    • BREAKING ReadableStreamDefaultReader.readAsStream is now generic as
      in actual stream.
    • BREAKING ReadableStream.fromTypedDataStream now have 2 generic
      parameters T extends TypedData and AbortType extends JSAny instead of
      single AbortType.
      Method itself now always returns ReadableStream<JSUint8Array, AbortType>,
      this means that any TypedData is re-viewed to be Uint8List.
    • BREAKING RequestBody and ResponseBody now constructable only from
      JS types:
      • Removed fromByteBuffer instead added fromJSArrayBuffer.
      • Removed fromTypedData instead added fromJSTypedArray.
      • Removed fromString instead added fromJSString.
      • fromReadableStream tightened type to ReadableStream<JSUint8Array, JSAny>
        because fetch supports only streams of Uint8Arrays.
    • BREAKING Fixed typo RequestDestination.sharedworker to
      RequestDestination.sharedWorker.
    • Fixed Response and Request not working in WASM: this happened due to JS
      runtime being more lax in type assertions, namely JSString as String is
      ok in JS runtime, but fails in WASM.
    • Response and Request now uses precise type
      ReadableStream<JSUint8Array, JSAny>

    2.1.0

    • Add package:fetch_api/enums.dart fetch_api.enums package with enumerations
      available to all platforms (including VM).
    • Use DOMException from package:web instead 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:web with WASM support.
    • Full rewrite to use extension types - no more InstanceMembers.
    • Internal JS Iterators are now fully covered with generics.
    • JS Iterator is no longer exported via public API.
    • Headers uses (String, String) in entries instead of List<String>.
    • FetchOptions and RequestOptions are now inherited from RequestInit
      and interchangeable.
    • ReadableStreamSource start, pull and cancel are now only callable
      via JS interop, as they require binding to parent object.

    1.0.3

    • Remove type from IteratorInstanceMembers to support old language
      version.
      Technically this is a breaking, and IteratorResult falls back to dynamic
      now, but it isn't exposed via public API and wrapper still works the same.
    Open source →
    Release notes

    Current usage is mostly limited to package:fetch_client and these changes restores WASM support, therefore no major version bump was made.

    • BREAKING ReadableStreamDefaultReader.readAsStream is now generic as in actual stream.
    • BREAKING ReadableStream.fromTypedDataStream now have 2 generic parameters T extends TypedData and AbortType extends JSAny instead of single AbortType. Method itself now always returns ReadableStream<JSUint8Array, AbortType>, this means that any TypedData is re-viewed to be Uint8List.
    • BREAKING RequestBody and ResponseBody now constructible only from JS types:
      • Removed fromByteBuffer instead added fromJSArrayBuffer.
      • Removed fromTypedData instead added fromJSTypedArray.
      • Removed fromString instead added fromJSString.
      • fromReadableStream tightened type to ReadableStream<JSUint8Array, JSAny> because fetch supports only streams of Uint8Arrays.
    • BREAKING Fixed typo RequestDestination.sharedworker to RequestDestination.sharedWorker.
    • Fixed Response and Request not working in WASM: this happened due to JS runtime being more lax in type assertions, namely JSString as String is ok in JS runtime, but fails in WASM.
    • Response and Request now use precise type ReadableStream<JSUint8Array, JSAny>
    Open source →
  4. 2.1.0 04 May 2024
    Release notes
    • Add package:fetch_api/enums.dart fetch_api.enums package with enumerations available for all platforms (including VM).
    • Use DOMException from package:web instead of alias toJSObject.
    • Enumerations use if (dart.library.io) '' for documentation-only imports, this allows to use them in non-JS environments.
    Open source →
  5. 2.0.0 15 Apr 2024
    Release notes
    • BREAKING: migrate to package:web with WASM support.
    • Full rewrite to use extension types - no more InstanceMembers.
    • Internal JS Iterators are now fully covered with generics.
    • JS Iterator is no longer exported via public API.
    • Headers now use (String, String) in entries instead of List<String>.
    • FetchOptions and RequestOptions are now inherited from RequestInit and interchangeable.
    • ReadableStreamSource start, pull and cancel are now only callable via JS interop, as they require binding to parent object.
    Open source →
  6. 2.0.0-wasm 08 Feb 2024 pre-release

    Nothing published for this version

  7. 1.0.3 30 Oct 2023
    Release notes
    • Remove type from IteratorInstanceMembers to support old language version. Technically this is a breaking, and IteratorResult falls back to dynamic now, but it isn't exposed via public API and wrapper still works the same.
    Open source →
  8. 1.0.2 06 Oct 2023
    Release notes
    • Change Iterator to static interop.
      Workaround for sdk#53532.
    Open source →
    Release notes
    • Change Iterator to static interop. Workaround for sdk#53532.
    Open source →
  9. 1.0.1 12 Mar 2023
    Release notes
    • Downgraded js dependency to ^0.6.5 (#2).
    Open source →
    Release notes
    • Downgraded js dependency to ^0.6.5 (#2.
    Open source →
  10. 1.0.0 23 Feb 2023
    Release notes
    • Public stable release.
    • Bumped js to 0.6.7.
    Open source →
    Release notes
    • Public stable release.
    • Bumped js dependency to ^0.6.7.
    Open source →
  11. 1.0.0-dev.5 13 Feb 2023 pre-release
    Release notes
    • BREAKING: Renamed RequestInit to FetchOptions.
      This is done to make emphasis, that fetch and Request have 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 ReadableStreamSource class that helps you to create custom source
      for ReadableStreams. It can be created from Dart'sStream.
    • Added RequestCache.
    • Added RequestDestination.
    • Added missing options to RequestMode and added docs.
    • Added FetchOptions and RequestOptions with corresponding docs from MDN.
    • Compatibility layer:
      • BREAKING: Renamed createRequestInit to createFetchOptions
      • Added createRequestOptions.
      • Added createReadableStream.
      • Added createReadableStreamSourceFromStream.
    • Fixed dev dependencies versions, to allow running on Dart 2.19.
    Open source →
    Release notes
    • BREAKING: Renamed RequestInit to FetchOptions. This is done to make emphatic, that fetch and Request have 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 ReadableStreamSource class that helps you to create custom source for ReadableStreams. It can be created from Dart's Stream.
    • Added RequestCache.
    • Added RequestDestination.
    • Added missing options to RequestMode and added docs.
    • Added FetchOptions and RequestOptions with corresponding docs from MDN.
    • Compatibility layer:
      • BREAKING: Renamed createRequestInit to createFetchOptions
      • Added createRequestOptions.
      • Added createReadableStream.
      • Added createReadableStreamSourceFromStream.
    • Fixed dev dependency versions, to allow running on Dart 2.19.
    Open source →
  12. 1.0.0-dev.4 23 Jan 2023 pre-release
    Release notes
    • Fixes for js.Iterator with Arrays. (Resolves issue with Headers).
    Open source →
    Release notes
    • Fixes for js.Iterator with Arrays. (Resolves issue with Headers).
    Open source →
  13. 1.0.0-dev.3 23 Jan 2023 pre-release
    Release notes
    • BREAKING: Renamed extensions from <Class>Extension to <Class>InstanceMembers.
    • Added fetch_api.compatibility_layer library to support Dart 2.19.
      • Added createHeadersFromMap
      • Added createHeadersFromArray
      • Added createRequestInit
      • Added createAbortSignalTimeout
    Open source →
    Release notes
    • BREAKING: Renamed extensions from <Class>Extension to <Class>InstanceMembers.

    • Added fetch_api.compatibility_layer library to support Dart 2.19.

      • Added createHeadersFromMap
      • Added createHeadersFromArray
      • Added createRequestInit
      • Added createAbortSignalTimeout
    • AbortSignal

      • Added timeout constructor-like method.
      • Added abort constructor-like method.
      • Added aborted property.
      • Added reason property.
      • Added throwIfAborted method.
    • AbortController

      • Added docs.
    • fetch() added docs.

    • Response

      • Fixed internal definition for _formData method.
      • Added docs.
    • Headers

      • Added docs.
    • Iterator and IteratorResult

      • Added docs.
    • ReadableStreamDefaultReader and ReadableStreamDefaultReaderChunk

      • Added docs.
    Open source →
  14. 1.0.0-dev.2 22 Jan 2023 pre-release
    Release notes
    • Downgraded js dependency to ^0.6.5.
    Open source →
    Release notes
    • Downgraded js dependency to ^0.6.5.
    Open source →
  15. 1.0.0-dev.1 22 Jan 2023 pre-release
    Release notes
    • Initial version.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive