From 5c5a926a59ad00da309a6d3153efa66ffdcb2390 Mon Sep 17 00:00:00 2001 From: angcyo Date: Tue, 29 Oct 2024 12:18:58 +0800 Subject: [PATCH] Add README examples document title anchors (#2317) --- dio/README-ZH.md | 20 ++++++++++---------- dio/README.md | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dio/README-ZH.md b/dio/README-ZH.md index 29a7cc398..a48ec6cbb 100644 --- a/dio/README-ZH.md +++ b/dio/README-ZH.md @@ -110,7 +110,7 @@ void getHttp() async { ## 示例 -发起一个 `GET` 请求 : +### 发起一个 `GET` 请求 : ```dart import 'package:dio/dio.dart'; @@ -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( @@ -151,7 +151,7 @@ response = await dio.download( ); ``` -以流的方式接收响应数据: +### 以流的方式接收响应数据: ```dart final rs = await dio.get( @@ -161,7 +161,7 @@ final rs = await dio.get( print(rs.data.stream); // 响应流 ``` -以二进制数组的方式接收响应数据: +### 以二进制数组的方式接收响应数据: ```dart final rs = await dio.get( @@ -171,7 +171,7 @@ final rs = await dio.get( print(rs.data); // 类型: List ``` -发送 `FormData`: +### 发送 `FormData`: ```dart final formData = FormData.fromMap({ @@ -181,7 +181,7 @@ final formData = FormData.fromMap({ final response = await dio.post('/info', data: formData); ``` -通过 `FormData` 上传多个文件: +### 通过 `FormData` 上传多个文件: ```dart final formData = FormData.fromMap({ @@ -196,7 +196,7 @@ final formData = FormData.fromMap({ final response = await dio.post('/info', data: formData); ``` -监听发送(上传)数据进度: +### 监听发送(上传)数据进度: ```dart final response = await dio.post( @@ -208,7 +208,7 @@ final response = await dio.post( ); ``` -以流的形式提交二进制数据: +### 以流的形式提交二进制数据: ```dart // Binary data diff --git a/dio/README.md b/dio/README.md index 4b28dec3b..8cb01fdf2 100644 --- a/dio/README.md +++ b/dio/README.md @@ -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'; @@ -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( @@ -135,7 +135,7 @@ response = await dio.download( ); ``` -Get response stream: +### Get response stream: ```dart final rs = await dio.get( @@ -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>( @@ -155,7 +155,7 @@ final rs = await Dio().get>( print(rs.data); // Type: List. ``` -Sending a `FormData`: +### Sending a `FormData`: ```dart final formData = FormData.fromMap({ @@ -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({ @@ -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( @@ -192,7 +192,7 @@ final response = await dio.post( ); ``` -Post binary data with Stream: +### Post binary data with Stream: ```dart // Binary data