Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Fix READMEs #1987

Merged
merged 2 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ Language: [English](README.md) | 简体中文
[![Pub](https://img.shields.io/pub/v/dio.svg?label=dev&include_prereleases)](https://pub.flutter-io.cn/packages/dio)

**在你更新之前:大版本和次要版本可能会包含不兼容的重大改动。<br/>
请阅读 [迁移指南](dio/migration_guide.md) 了解完整的重大变更内容。**
请阅读 [迁移指南][] 了解完整的重大变更内容。**

[迁移指南]: https://pub.flutter-io.cn/documentation/dio/latest/topics/Migration%20Guide-topic.html

### 插件

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Please move specific paths for project instructions.
[![Pub](https://img.shields.io/pub/v/dio.svg?label=dev&include_prereleases)](https://pub.dev/packages/dio)

**Before you upgrade: Breaking changes might happen in major and minor versions of packages.<br/>
See the [Migration Guide](dio/migration_guide.md) for the complete breaking changes list.**
See the [Migration Guide][] for the complete breaking changes list.**

[Migration Guide]: https://pub.dev/documentation/dio/latest/topics/Migration%20Guide-topic.html

### Plugins

Expand Down
36 changes: 20 additions & 16 deletions dio/README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ dio 是一个强大的 HTTP 网络请求库,支持全局配置、Restful API
* [QueuedInterceptor](#queuedinterceptor)
* [例子](#例子)
* [日志拦截器](#日志拦截器)
* [Dart](#dart)
* [Flutter](#flutter)
* [自定义拦截器](#自定义拦截器)
* [错误处理](#错误处理)
* [DioException](#dioexception)
Expand All @@ -54,11 +56,14 @@ dio 是一个强大的 HTTP 网络请求库,支持全局配置、Restful API

### 添加依赖

依照文档将 `dio` 包添加为 [pubspec 的依赖](https://pub.flutter-io.cn/packages/dio/install)。
依照文档将 `dio` 包添加为
[pubspec 的依赖](https://pub.flutter-io.cn/packages/dio/install)。

**在你更新之前:大版本和次要版本可能会包含不兼容的重大改动。<br/>
请阅读 [迁移指南][] 了解完整的重大变更内容。**

[迁移指南]: https://pub.flutter-io.cn/documentation/dio/latest/topics/Migration%20Guide-topic.html

## 一个极简的示例

```dart
Expand All @@ -79,20 +84,20 @@ void getHttp() async {
### 相关插件

<!-- 使用 https://pub.flutter-io.cn 作为管理网址 -->
| 仓库 | 最新版本 | 描述 |
|--------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|
| [dio_cookie_manager](https://github.com/cfug/dio/blob/main/plugins/cookie_manager) | [![Pub](https://img.shields.io/pub/v/dio_cookie_manager.svg)](https://pub.flutter-io.cn/packages/dio_cookie_manager) | Cookie 管理 |
| [dio_http2_adapter](https://github.com/cfug/dio/blob/main/plugins/http2_adapter) | [![Pub](https://img.shields.io/pub/v/dio_http2_adapter.svg)](https://pub.flutter-io.cn/packages/dio_http2_adapter) | 支持 HTTP/2 的自定义适配器 |
| [native_dio_adapter](https://github.com/cfug/dio/blob/main/plugins/native_dio_adapter) | [![Pub](https://img.shields.io/pub/v/native_dio_adapter.svg)](https://pub.flutter-io.cn/packages/native_dio_adapter) | 使用 cupertino_http 和 cronet_http 以适配器代理实现的原生网络请求功能。 |
| [dio_smart_retry](https://github.com/rodion-m/dio_smart_retry) | [![Pub](https://img.shields.io/pub/v/dio_smart_retry.svg)](https://pub.flutter-io.cn/packages/dio_smart_retry) | 支持灵活地请求重试 |
| [http_certificate_pinning](https://github.com/diefferson/http_certificate_pinning) | [![Pub](https://img.shields.io/pub/v/http_certificate_pinning.svg)](https://pub.flutter-io.cn/packages/http_certificate_pinning) | 用于 Flutter 的 HTTPS 证书锁定 |
| [dio_intercept_to_curl](https://github.com/blackflamedigital/dio_intercept_to_curl) | [![Pub](https://img.shields.io/pub/v/dio_intercept_to_curl.svg)](https://pub.flutter-io.cn/packages/dio_intercept_to_curl) | 用于 Flutter 的 CURL 命令生成器 |
| [dio_cache_interceptor](https://github.com/llfbandit/dio_cache_interceptor) | [![Pub](https://img.shields.io/pub/v/dio_cache_interceptor.svg)](https://pub.flutter-io.cn/packages/dio_cache_interceptor) | 具有多个符合 HTTP 指令的 HTTP 缓存拦截器, |
| [dio_http_cache](https://github.com/hurshi/dio-http-cache) | [![Pub](https://img.shields.io/pub/v/dio_http_cache.svg)](https://pub.flutter-io.cn/packages/dio_http_cache) | 类似 Android 中的 RxCache 的缓存管理 |
| [pretty_dio_logger](https://github.com/Milad-Akarie/pretty_dio_logger) | [![Pub](https://img.shields.io/pub/v/pretty_dio_logger.svg)](https://pub.flutter-io.cn/packages/pretty_dio_logger) | 基于拦截器的简明易读的请求日志打印 |
| [dio_image_provider](https://github.com/ueman/image_provider) | [![Pub](https://img.shields.io/pub/v/dio_image_provider.svg)](https://pub.flutter-io.cn/packages/dio_image_provider) | 基于 Dio 的图片加载 |
| [flutter_ume_kit_dio](https://github.com/cfug/flutter_ume_kits/tree/main/packages/flutter_ume_kit_dio) | [![Pub](https://img.shields.io/pub/v/flutter_ume_kit_dio.svg)](https://pub.flutter-io.cn/packages/flutter_ume_kit_dio) | flutter_ume 上的 dio 调试插件 |
| [talker_dio_logger](https://github.com/Frezyx/talker/tree/master/packages/talker_dio_logger) | [![Pub](https://img.shields.io/pub/v/talker_dio_logger.svg)](https://pub.dev/packages/talker_dio_logger) | 基于 talker 的轻量级和可定制的 dio 记录器 |
| 仓库 | 最新版本 | 描述 |
|--------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|
| [dio_cookie_manager](https://github.com/cfug/dio/blob/main/plugins/cookie_manager) | [![Pub](https://img.shields.io/pub/v/dio_cookie_manager.svg)](https://pub.flutter-io.cn/packages/dio_cookie_manager) | Cookie 管理 |
| [dio_http2_adapter](https://github.com/cfug/dio/blob/main/plugins/http2_adapter) | [![Pub](https://img.shields.io/pub/v/dio_http2_adapter.svg)](https://pub.flutter-io.cn/packages/dio_http2_adapter) | 支持 HTTP/2 的自定义适配器 |
| [native_dio_adapter](https://github.com/cfug/dio/blob/main/plugins/native_dio_adapter) | [![Pub](https://img.shields.io/pub/v/native_dio_adapter.svg)](https://pub.flutter-io.cn/packages/native_dio_adapter) | 使用 cupertino_http 和 cronet_http 以适配器代理实现的原生网络请求功能。 |
| [dio_smart_retry](https://github.com/rodion-m/dio_smart_retry) | [![Pub](https://img.shields.io/pub/v/dio_smart_retry.svg)](https://pub.flutter-io.cn/packages/dio_smart_retry) | 支持灵活地请求重试 |
| [http_certificate_pinning](https://github.com/diefferson/http_certificate_pinning) | [![Pub](https://img.shields.io/pub/v/http_certificate_pinning.svg)](https://pub.flutter-io.cn/packages/http_certificate_pinning) | 用于 Flutter 的 HTTPS 证书锁定 |
| [dio_intercept_to_curl](https://github.com/blackflamedigital/dio_intercept_to_curl) | [![Pub](https://img.shields.io/pub/v/dio_intercept_to_curl.svg)](https://pub.flutter-io.cn/packages/dio_intercept_to_curl) | 用于 Flutter 的 CURL 命令生成器 |
| [dio_cache_interceptor](https://github.com/llfbandit/dio_cache_interceptor) | [![Pub](https://img.shields.io/pub/v/dio_cache_interceptor.svg)](https://pub.flutter-io.cn/packages/dio_cache_interceptor) | 具有多个符合 HTTP 指令的 HTTP 缓存拦截器, |
| [dio_http_cache](https://github.com/hurshi/dio-http-cache) | [![Pub](https://img.shields.io/pub/v/dio_http_cache.svg)](https://pub.flutter-io.cn/packages/dio_http_cache) | 类似 Android 中的 RxCache 的缓存管理 |
| [pretty_dio_logger](https://github.com/Milad-Akarie/pretty_dio_logger) | [![Pub](https://img.shields.io/pub/v/pretty_dio_logger.svg)](https://pub.flutter-io.cn/packages/pretty_dio_logger) | 基于拦截器的简明易读的请求日志打印 |
| [dio_image_provider](https://github.com/ueman/image_provider) | [![Pub](https://img.shields.io/pub/v/dio_image_provider.svg)](https://pub.flutter-io.cn/packages/dio_image_provider) | 基于 Dio 的图片加载 |
| [flutter_ume_kit_dio](https://github.com/cfug/flutter_ume_kits/tree/main/packages/flutter_ume_kit_dio) | [![Pub](https://img.shields.io/pub/v/flutter_ume_kit_dio.svg)](https://pub.flutter-io.cn/packages/flutter_ume_kit_dio) | flutter_ume 上的 dio 调试插件 |
| [talker_dio_logger](https://github.com/Frezyx/talker/tree/master/packages/talker_dio_logger) | [![Pub](https://img.shields.io/pub/v/talker_dio_logger.svg)](https://pub.flutter-io.cn/packages/talker_dio_logger) | 基于 talker 的轻量级和可定制的 dio 记录器 |

### 相关的项目

Expand Down Expand Up @@ -881,6 +886,5 @@ class MyDio with DioMixin implements Dio {

你可以参考简单请求的定义修改你的请求,或者为你的服务加上 CORS 中间件进行跨域处理。

[迁移指南]: ./migration_guide.md
[简单请求]: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/CORS#%E7%AE%80%E5%8D%95%E8%AF%B7%E6%B1%82
[CORS 预检]: https://developer.mozilla.org/zh-CN/docs/Glossary/Preflight_request
15 changes: 9 additions & 6 deletions dio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ Timeout, Custom adapters, Transformers, etc.
<!-- TOC -->
* [dio](#dio)
* [Get started](#get-started)
* [Add dependency](#add-dependency)
* [Install](#install)
* [Super simple to use](#super-simple-to-use)
* [Awesome dio](#awesome-dio)
* [Plugins](#plugins)
* [Related Projects](#related-projects)
* [Examples](#examples)
* [Dio APIs](#dio-apis)
* [Creating an instance and set default configs.](#creating-an-instance-and-set-default-configs)
Expand All @@ -31,6 +30,8 @@ Timeout, Custom adapters, Transformers, etc.
* [QueuedInterceptor](#queuedinterceptor)
* [Example](#example)
* [LogInterceptor](#loginterceptor)
* [Dart](#dart)
* [Flutter](#flutter)
* [Custom Interceptor](#custom-interceptor)
* [Handling Errors](#handling-errors)
* [DioException](#dioexception)
Expand All @@ -56,11 +57,13 @@ Timeout, Custom adapters, Transformers, etc.

### Install

Add the `dio` package to your [pubspec dependencies](https://pub.dev/packages/dio/install).

Add the `dio` package to your
[pubspec dependencies](https://pub.dev/packages/dio/install).

**Before you upgrade: Breaking changes might happen in major and minor versions of packages.<br/>
See the [Migration Guide](https://pub.dev/documentation/dio/latest/topics/Migration%20Guide-topic.html) for the complete breaking changes list.**
See the [Migration Guide][] for the complete breaking changes list.**

[Migration Guide]: https://pub.dev/documentation/dio/latest/topics/Migration%20Guide-topic.html

### Super simple to use

Expand Down Expand Up @@ -601,7 +604,7 @@ and it supports uploading files.
final formData = FormData.fromMap({
'name': 'dio',
'date': DateTime.now().toIso8601String(),
'file': await MultipartFile.fromFile('./text.txt',filename: 'upload.txt'),
'file': await MultipartFile.fromFile('./text.txt', filename: 'upload.txt'),
});
final response = await dio.post('/info', data: formData);
```
Expand Down
3 changes: 2 additions & 1 deletion plugins/cookie_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ A cookie manager combines cookie_jar and dio, based on the interceptor algorithm

### Install

Add the `dio_cookie_manager` package to your [pubspec dependencies](https://pub.dev/packages/dio_cookie_manager/install).
Add the `dio_cookie_manager` package to your
[pubspec dependencies](https://pub.dev/packages/dio_cookie_manager/install).

### Usage

Expand Down
3 changes: 2 additions & 1 deletion plugins/http2_adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ An adapter that combines HTTP/2 and dio. Supports reusing connections, header co

### Install

Add the `dio_http2_adapter` package to your [pubspec dependencies](https://pub.dev/packages/dio_http2_adapter/install).
Add the `dio_http2_adapter` package to your
[pubspec dependencies](https://pub.dev/packages/dio_http2_adapter/install).

### Usage

Expand Down
10 changes: 7 additions & 3 deletions plugins/native_dio_adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[![popularity](https://img.shields.io/pub/popularity/native_dio_adapter)](https://pub.dev/packages/native_dio_adapter/score)
[![pub points](https://img.shields.io/pub/points/native_dio_adapter)](https://pub.dev/packages/native_dio_adapter/score)

> Note: This uses the native http implementation on macOS, iOS and Android. Other platforms still use the Dart http stack.
> Note: This uses the native http implementation on macOS, iOS and Android.
> Other platforms still use the Dart http stack.
> Please keep in mind that Android is still considered experimental.

If you encounter bugs, consider fixing it by opening a PR or at least contribute a failing test case.
Expand All @@ -19,7 +20,9 @@ Inspired by the [Dart 2.18 release blog](https://medium.com/dartlang/dart-2-18-f

## Motivation

Using the native platform implementation, rather than the socket-based [`dart:io` HttpClient](https://api.dart.dev/stable/dart-io/HttpClient-class.html) implementation, has several advantages:
Using the native platform implementation, rather than the socket-based
[`dart:io` HttpClient](https://api.dart.dev/stable/dart-io/HttpClient-class.html) implementation,
has several advantages:

- It automatically supports platform features such VPNs and HTTP proxies.
- It supports many more configuration options such as only allowing access through WiFi and blocking cookies.
Expand All @@ -29,7 +32,8 @@ Using the native platform implementation, rather than the socket-based [`dart:io

### Install

Add the `native_dio_adapter` package to your [pubspec dependencies](https://pub.dev/packages/native_dio_adapter/install).
Add the `native_dio_adapter` package to your
[pubspec dependencies](https://pub.dev/packages/native_dio_adapter/install).

### Example

Expand Down