Search packages, repositories and app categories

Package detailsv2.3.1

fetch_api

JavaScript bindings for Fetch API, flexible HTTP requests, redirects, streaming and more.

Web
30-day downloads
96K
Likes
11
Pub points
140

Install package

flutter pub add fetch_api

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The fetch_api package provides JavaScript-style Fetch API bindings for Flutter web applications, enabling flexible and modern HTTP requests. It supports features like redirects, streaming responses, and intuitive request handling, closely mirroring the browser's native Fetch API. Designed specifically for web platforms, it simplifies making HTTP calls with a familiar interface. The package is lightweight and integrates seamlessly into web-based Flutter projects.

Use cases

  • Making HTTP GET and POST requests
  • Handling streaming responses
  • Managing redirects automatically
  • Implementing client-side APIs in web apps
  • Simplifying fetch-based interactions

Key features

  • JavaScript Fetch API compatibility
  • Streaming response support
  • Automatic redirect handling
  • Simple, chainable syntax
  • Web-only platform targeting

Suitable for

  • Web-only Flutter projects
  • Frontend web applications
  • API integrations on the web
  • Developers familiar with JavaScript fetch
  • Projects needing lightweight HTTP clients

Considerations

  • Not available on mobile or desktop platforms
  • Limited to web environment
  • Relies on browser's native fetch
  • No built-in error retry logic
  • Requires careful handling of async streams

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Fetch API

pub package package publisher

This package provides WASM-ready Dart bindings to JavaScript Fetch API.

Features

  • Full fetch options / request parameters coverage
  • Cancel requests via AbortController.
  • Read response
    • As text (String)
    • As Blob
    • As Stream of Uint8List
  • Response streaming
  • Request streaming (check compatibility)
  • Get access to redirect status
  • Support non-200 responses

Some notes about fetch and Request

fetch and Request have same options but different semantics, e.g. fetch's default mode is no-cors while Request's cors. Therefore, options objects of fetch function and Request constructor made as different extension types, although they are interchangeable and both inherited from RequestInit.

For more info about that, read MDN docs.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package