diff --git a/dio/README-ZH.md b/dio/README-ZH.md index 545b64958..6ccca968a 100644 --- a/dio/README-ZH.md +++ b/dio/README-ZH.md @@ -692,7 +692,7 @@ void main() { 我们通过 `HttpClientAdapter` 将 `Dio` 和 `HttpClient` 解耦, 这样一来便可以自由定制 HTTP 请求的底层实现。 Dio 使用 `IOHttpClientAdapter` 作为原生平台默认的桥梁, -`BrowserClientAdapter` 作为 Web 平台的桥梁。 +`BrowserHttpClientAdapter` 作为 Web 平台的桥梁。 你可以通过 `HttpClientAdapter()` 来根据平台创建它们。 ```dart @@ -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) 中包含了一个简单的自定义桥接。 diff --git a/dio/README.md b/dio/README.md index cf38d5c26..c415d8f72 100644 --- a/dio/README.md +++ b/dio/README.md @@ -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 @@ -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.