Skip to content

Commit 5bd783b

Browse files
author
Cristian Vargas
committed
Fix more issues on README. This includes a broken link and several typos.
1 parent 82e9af6 commit 5bd783b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Language: [English](https://github.com/flutterchina/dio) | [中文简体](https:
22

33
# dio
44

5-
[![build statud](https://img.shields.io/travis/flutterchina/dio/vm.svg?style=flat-square)](https://travis-ci.org/flutterchina/dio)
5+
[![build status](https://img.shields.io/travis/flutterchina/dio/vm.svg?style=flat-square)](https://travis-ci.org/flutterchina/dio)
66
[![Pub](https://img.shields.io/pub/v/dio.svg?style=flat-square)](https://pub.dartlang.org/packages/dio)
77
[![coverage](https://img.shields.io/codecov/c/github/flutterchina/dio/vm.svg?style=flat-square)](https://codecov.io/github/flutterchina/dio?branch=vm)
88
[![support](https://img.shields.io/badge/platform-flutter%7Cdart%20vm-ff69b4.svg?style=flat-square)](https://github.com/flutterchina/dio)
@@ -96,7 +96,7 @@ FormData formData = new FormData.from({
9696
response = await dio.post("/info", data: formData)
9797
```
9898

99-
Uploading multiple files to server by FormData:
99+
Uploading multiple files to server by FormData:
100100

101101
```dart
102102
FormData formData = new FormData.from({
@@ -113,13 +113,13 @@ FormData formData = new FormData.from({
113113
response = await dio.post("/info", data: formData)
114114
```
115115

116-
…you can find all examples code [here](https://github.com/flutterchina/dio/tree/flutter/example).
116+
…you can find all examples code [here](https://github.com/flutterchina/dio/tree/flutter/example).
117117

118118
## Dio APIs
119119

120120
### Creating an instance and set default configs.
121121

122-
You can create instance of Dio with a optional `Options` object:
122+
You can create instance of Dio with an optional `Options` object:
123123

124124
```dart
125125
Dio dio = new Dio; // with default Options
@@ -138,7 +138,7 @@ Options options= new Options(
138138
Dio dio = new Dio(options);
139139
```
140140

141-
The core API in Dio instance is :
141+
The core API in Dio instance is:
142142

143143
**Future<Response> request(String path, {data, Options options,CancelToken cancelToken})**
144144

@@ -170,7 +170,7 @@ For convenience aliases have been provided for all supported request methods.
170170

171171
## Request Options
172172

173-
These are the available config options for making requests. Requests will default to `GET` if `method` is not specified.
173+
These are the available config options for making requests. Requests will default to `GET` if `method` is not specified.
174174

175175
```dart
176176
{
@@ -247,7 +247,7 @@ The response for a request contains the following information.
247247
}
248248
```
249249

250-
When request is succeed, you will receive the response as follows:
250+
When request is succeed, you will receive the response as follows:
251251

252252
```dart
253253
Response response=await dio.get("https://www.google.com");
@@ -290,7 +290,7 @@ dio.interceptor.response.onError=null;
290290

291291
### Resolve and reject the request
292292

293-
In all interceptors, you can interfere with their execution flow. If you want to resolve the request/response with some custom data, you can return a `Response` object or return `dio.resolve(data)`. If you want to reject the request/response with a error message, you can return a `DioError` object or return `dio.reject(errMsg)` .
293+
In all interceptors, you can interfere with their execution flow. If you want to resolve the request/response with some custom data,you can return a `Response` object or return `dio.resolve(data)`. If you want to reject the request/response with a error message, you can return a `DioError` object or return `dio.reject(errMsg)` .
294294

295295
```dart
296296
dio.interceptor.request.onSend = (Options options){
@@ -334,11 +334,11 @@ dio.interceptor.request.onSend = (Options options) async{
334334
}
335335
```
336336

337-
you can clean the waiting queue by calling `clear()`;
337+
You can clean the waiting queue by calling `clear()`;
338338

339339
### aliases
340340

341-
When the **request** interceptor is locked, the incoming request will pause, this is equivalent to we locked the current dio instance, Therefore, Dio provied the two aliases for the `lock/unlock` of **request** interceptors.
341+
When the **request** interceptor is locked, the incoming request will pause, this is equivalent to we locked the current dio instance, Therefore, Dio provied the two aliases for the `lock/unlock` of **request** interceptors.
342342

343343
**dio.lock() == dio.interceptor.request.lock()**
344344

@@ -350,7 +350,7 @@ When the **request** interceptor is locked, the incoming request will pause, thi
350350

351351
### Example
352352

353-
Because of security reasons, we need all the requests to set up a csrfToken in the header, if csrfToken does not exist, we need to request a csrfToken first, and then perform the network request, because the request csrfToken progress is asynchronous, so we need to execute this async request in request interceptor. the code is as follows:
353+
Because of security reasons, we need all the requests to set up a csrfToken in the header, if csrfToken does not exist, we need to request a csrfToken first, and then perform the network request, because the request csrfToken progress is asynchronous, so we need to execute this async request in request interceptor. The code is as follows:
354354

355355
```dart
356356
dio.interceptor.request.onSend = (Options options) {
@@ -452,11 +452,11 @@ dio.options.contentType=ContentType.parse("application/x-www-form-urlencoded");
452452
dio.post("/info",data:{"id":5}, options: new Options(contentType:ContentType.parse("application/x-www-form-urlencoded")))
453453
```
454454

455-
There is a example [here](https://github.com/flutterchina/dio/tree/flutter/example/options.dart).
455+
There is an example [here](https://github.com/flutterchina/dio/tree/flutter/example/options.dart).
456456

457457
## Sending FormData
458458

459-
You can also send FormData with Dio, which will send data in the `multipart/form-data`, and it supports upload files.
459+
You can also send FormData with Dio, which will send data in the `multipart/form-data`, and it supports uploading files.
460460

461461
```dart
462462
FormData formData = new FormData.from({
@@ -473,13 +473,13 @@ There is a complete example [here](https://github.com/flutterchina/dio/tree/flut
473473

474474
## Transformer
475475

476-
`Transformer` allows changes to the request/response data before it is sent/received to/from the server. This is only applicable for request methods 'PUT', 'POST', and 'PATCH'. Dio has already implemented a `DefaultTransformer`, and as the default `Transformer`. If you want to custom the transformation of request/response data, you can provide a `Transformer` by your self, and replace the `DefaultTransformer` by setting the `dio.transformer`.
476+
`Transformer` allows changes to the request/response data before it is sent/received to/from the server. This is only applicable for request methods 'PUT', 'POST', and 'PATCH'. Dio has already implemented a `DefaultTransformer`, and as the default `Transformer`. If you want to customize the transformation of request/response data, you can provide a `Transformer` by your self, and replace the `DefaultTransformer` by setting the `dio.transformer`.
477477

478-
There is example for [customing Transformer](https://github.com/flutterchina/dio/blob/master/example/Transformer.dart).
478+
There is an example for [customizing Transformer](https://github.com/flutterchina/dio/blob/flutter/example/Transformer.dart).
479479

480480
## Set proxy and HttpClient config
481481

482-
Dio use HttpClient to send http request, so you can config the `dio.httpClient` to support `porxy`, for example:
482+
Dio uses HttpClient to send http request, so you can config the `dio.httpClient` to support `proxy`, for example:
483483

484484
```dart
485485
dio.onHttpClientCreate = (HttpClient client) {

0 commit comments

Comments
 (0)