Skip to content

Commit

Permalink
feat!: 1.0.0-dev.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekfad committed Jan 23, 2023
1 parent 414c4d2 commit e7b0e05
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
## 1.0.0-dev.2

- Bumped `fetch_api` dependency to `^1.0.0-dev.3`.
- Use `fetch_api.compatibility_layer` to support Dart 2.19.
- Fixed name of example file.

## 1.0.0-dev.2

- Bumped `fetch_api` dependency to `^1.0.0-dev.2`.
- Downgraded `js` dependency to `^0.6.5`.


## 1.0.0-dev.1

- Initial version.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Fetch API.

> ⚠️ Requires Dart 2.19 or higher.
This package provides [package:http](https://pub.dev/packages/http) client based
of [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
on [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).

## Features

* Abort requests
* Support streaming of data
* Get access to redirect status
* Support non-200 responses
* Cancel requests
* Support data streaming
* Get access to redirect URL and status
* Support non-`200` responses
File renamed without changes.
5 changes: 3 additions & 2 deletions lib/src/fetch_client.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:fetch_api/compatibility_layer.dart' as fetch_compatibility_layer;
import 'package:fetch_api/fetch_api.dart';
import 'package:http/http.dart' show BaseClient, BaseRequest, BaseResponse, ClientException;
import 'fetch_response.dart';
Expand Down Expand Up @@ -54,13 +55,13 @@ class FetchClient extends BaseClient {
Future<FetchResponse> send(BaseRequest request) async {
final body = await request.finalize().toBytes();
final abortController = AbortController();
final init = RequestInit(
final init = fetch_compatibility_layer.createRequestInit(
body: body.isEmpty ? null : body,
method: request.method,
redirect: request.followRedirects
? RequestRedirect.follow
: RequestRedirect.error,
headers: Headers.fromMap(request.headers),
headers: fetch_compatibility_layer.createHeadersFromMap(request.headers),
mode: mode,
credentials: credentials,
cache: cache,
Expand Down
12 changes: 8 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fetch_client
description: Fetch based client for http package, enables streamed requests on web.
version: 1.0.0-dev.2
description: Client for http package based on Fetch API, enables streamed requests on web and more.
version: 1.0.0-dev.3
homepage: https://github.com/Zekfad/fetch_client
repository: https://github.com/Zekfad/fetch_client
issue_tracker: https://github.com/Zekfad/fetch_client/issues
Expand All @@ -10,12 +10,16 @@ platforms:
web:

environment:
sdk: '>=2.18.0 <4.0.0'
sdk: '>=2.19.0-0 <4.0.0'

dependencies:
fetch_api: ^1.0.0-dev.2
fetch_api: ^1.0.0-dev.3
http: ^0.13.5

# dependency_overrides:
# fetch_api:
# git: https://github.com/Zekfad/fetch_api

dev_dependencies:
build_runner: ^2.3.3
build_web_compilers: ^3.2.7
Expand Down

0 comments on commit e7b0e05

Please sign in to comment.