Skip to content

Commit

Permalink
docs: 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
lei-mu committed May 25, 2023
1 parent 2696220 commit d3f0301
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
###### 使用npm

``` javascript
npm i luch-request -S
npm install luch-request -S
```
使用npm前阅读[快速上手](https://www.quanzhan.co/luch-request/handbook/#npm "快速上手")

Expand Down Expand Up @@ -83,7 +83,8 @@ http.get('/user/login', {
// 自定义验证器。statusCode必存在。非必填
validateStatus: function validateStatus(statusCode) {
return statusCode >= 200 && statusCode < 300
}
},
// forcedJSONParsing: true, // 是否尝试将响应数据json化,默认为true。如果失败则返回原数据
}).then(res => {

}).catch(err => {
Expand Down Expand Up @@ -165,7 +166,9 @@ http.post('/user/login', {userName: 'name', password: '123456'}, {
// uploadTask.abort();
// }
// });
}
},
// 是否尝试将响应数据json化。boolean 或者一个包含include的对象。非必填。默认true。include为数组,包含需要json化的method
// forcedJSONParsing: {include: ['UPLOAD', 'DOWNLOAD']}
}).then(res => {
// 返回的res.data 已经进行JSON.parse
}).catch(err => {
Expand Down

0 comments on commit d3f0301

Please sign in to comment.