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

Changes made in both Readme files #2016

Merged
merged 1 commit into from
Nov 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
6 changes: 3 additions & 3 deletions dio/README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ void main() {
我们通过 `HttpClientAdapter` 将 `Dio` 和 `HttpClient` 解耦,
这样一来便可以自由定制 HTTP 请求的底层实现。
Dio 使用 `IOHttpClientAdapter` 作为原生平台默认的桥梁,
`BrowserClientAdapter` 作为 Web 平台的桥梁。
`BrowserHttpClientAdapter` 作为 Web 平台的桥梁。
你可以通过 `HttpClientAdapter()` 来根据平台创建它们。

```dart
Expand All @@ -704,13 +704,13 @@ dio.httpClientAdapter = HttpClientAdapter();
```dart
import 'package:dio/browser.dart';
// ...
dio.httpClientAdapter = BrowserClientAdapter();
dio.httpClientAdapter = BrowserHttpClientAdapter();
```
- 对于原生平台:
```dart
import 'package:dio/io.dart';
// ...
dio.httpClientAdapter = IOClientAdapter();
dio.httpClientAdapter = IOHttpClientAdapter();
```

[示例](../example/lib/adapter.dart) 中包含了一个简单的自定义桥接。
Expand Down
6 changes: 3 additions & 3 deletions dio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ There is an example for [customizing Transformer](../example/lib/transformer.dar
We can use any `HttpClient` not just `dart:io:HttpClient` to make HTTP requests.
And all we need is providing a `HttpClientAdapter`.
The default `HttpClientAdapter` for Dio is `IOHttpClientAdapter` on native platforms,
and `BrowserClientAdapter` on the Web platform.
and `BrowserHttpClientAdapter` on the Web platform.
They can be initiated by calling the `HttpClientAdapter()`.

```dart
Expand All @@ -729,13 +729,13 @@ If you want to use platform adapters explicitly:
```dart
import 'package:dio/browser.dart';
// ...
dio.httpClientAdapter = BrowserClientAdapter();
dio.httpClientAdapter = BrowserHttpClientAdapter();
```
- For native platforms:
```dart
import 'package:dio/io.dart';
// ...
dio.httpClientAdapter = IOClientAdapter();
dio.httpClientAdapter = IOHttpClientAdapter();
```

[Here](../example/lib/adapter.dart) is a simple example to custom adapter.
Expand Down