Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shehabmohamed0 authored Oct 29, 2024
2 parents 8eee312 + 5c5a926 commit 0c4614c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions dio/README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void getHttp() async {

## 示例

发起一个 `GET` 请求 :
### 发起一个 `GET` 请求 :

```dart
import 'package:dio/dio.dart';
Expand All @@ -130,19 +130,19 @@ void request() async {
}
```

发起一个 `POST` 请求:
### 发起一个 `POST` 请求:

```dart
response = await dio.post('/test', data: {'id': 12, 'name': 'dio'});
```

发起多个并发请求:
### 发起多个并发请求:

```dart
response = await Future.wait([dio.post('/info'), dio.get('/token')]);
```

下载文件:
### 下载文件:

```dart
response = await dio.download(
Expand All @@ -151,7 +151,7 @@ response = await dio.download(
);
```

以流的方式接收响应数据:
### 以流的方式接收响应数据:

```dart
final rs = await dio.get(
Expand All @@ -161,7 +161,7 @@ final rs = await dio.get(
print(rs.data.stream); // 响应流
```

以二进制数组的方式接收响应数据:
### 以二进制数组的方式接收响应数据:

```dart
final rs = await dio.get(
Expand All @@ -171,7 +171,7 @@ final rs = await dio.get(
print(rs.data); // 类型: List<int>
```

发送 `FormData`:
### 发送 `FormData`:

```dart
final formData = FormData.fromMap({
Expand All @@ -181,7 +181,7 @@ final formData = FormData.fromMap({
final response = await dio.post('/info', data: formData);
```

通过 `FormData` 上传多个文件:
### 通过 `FormData` 上传多个文件:

```dart
final formData = FormData.fromMap({
Expand All @@ -196,7 +196,7 @@ final formData = FormData.fromMap({
final response = await dio.post('/info', data: formData);
```

监听发送(上传)数据进度:
### 监听发送(上传)数据进度:

```dart
final response = await dio.post(
Expand All @@ -208,7 +208,7 @@ final response = await dio.post(
);
```

以流的形式提交二进制数据:
### 以流的形式提交二进制数据:

```dart
// Binary data
Expand Down
20 changes: 10 additions & 10 deletions dio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ in [here](https://github.com/cfug/dio/issues/347).

## Examples

Performing a `GET` request:
### Performing a `GET` request:

```dart
import 'package:dio/dio.dart';
Expand All @@ -114,19 +114,19 @@ void request() async {
}
```

Performing a `POST` request:
### Performing a `POST` request:

```dart
response = await dio.post('/test', data: {'id': 12, 'name': 'dio'});
```

Performing multiple concurrent requests:
### Performing multiple concurrent requests:

```dart
response = await Future.wait([dio.post('/info'), dio.get('/token')]);
```

Downloading a file:
### Downloading a file:

```dart
response = await dio.download(
Expand All @@ -135,7 +135,7 @@ response = await dio.download(
);
```

Get response stream:
### Get response stream:

```dart
final rs = await dio.get(
Expand All @@ -145,7 +145,7 @@ final rs = await dio.get(
print(rs.data.stream); // Response stream.
```

Get response with bytes:
### Get response with bytes:

```dart
final rs = await Dio().get<List<int>>(
Expand All @@ -155,7 +155,7 @@ final rs = await Dio().get<List<int>>(
print(rs.data); // Type: List<int>.
```

Sending a `FormData`:
### Sending a `FormData`:

```dart
final formData = FormData.fromMap({
Expand All @@ -165,7 +165,7 @@ final formData = FormData.fromMap({
final response = await dio.post('/info', data: formData);
```

Uploading multiple files to server by FormData:
### Uploading multiple files to server by FormData:

```dart
final formData = FormData.fromMap({
Expand All @@ -180,7 +180,7 @@ final formData = FormData.fromMap({
final response = await dio.post('/info', data: formData);
```

Listening the uploading progress:
### Listening the uploading progress:

```dart
final response = await dio.post(
Expand All @@ -192,7 +192,7 @@ final response = await dio.post(
);
```

Post binary data with Stream:
### Post binary data with Stream:

```dart
// Binary data
Expand Down

0 comments on commit 0c4614c

Please sign in to comment.