Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnyshao committed Feb 8, 2019
1 parent 300f7bb commit 8be7740
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ wf.download({
Creating an instance
You can create a new instance of wefetch with a custom config
```
const instance = wf.create({
baseUrl: 'http://your-domain.com/api'
//....
})
const instance = wf.create({
baseUrl: 'http://your-domain.com/api'
//....
})
```
Instance methods
#### instance.request(config)
Expand All @@ -141,16 +141,15 @@ Instance methods
## Request Config
```
{
// `url` is the server URL that will be used for the request
url: '/user',
// `baseURL` will be prepended to `url`
baseUrl:'http://your-domain.com/api',
method: 'get', //default
// `uploadUrl` and `downloadUrl`,will be prepended to `url`。 if your project have a different request path, you can like this to set it:
uploadUrl:'http://your-domain.com/upload',
downloadUrl: 'http://your-domain.com/download',
timeout: 0
// `url` is the server URL that will be used for the request
url: '/user',
// `baseURL` will be prepended to `url`
baseUrl:'http://your-domain.com/api',
method: 'get', //default
// `uploadUrl` and `downloadUrl`,will be prepended to `url`。 if your project have a different request path, you can like this to set it:
uploadUrl:'http://your-domain.com/upload',
downloadUrl: 'http://your-domain.com/download',
timeout: 0
}
```
## Config Defaults
Expand Down Expand Up @@ -197,7 +196,7 @@ p.task.abort()
```
[RequestTaks](https://developers.weixin.qq.com/miniprogram/dev/api/RequestTask.html)

## promisify
## Promisify for Mini Program API
```js
const chooseImage = wf.promisify(wx.chooseImage)
// using in wechat Mini Program
Expand Down

0 comments on commit 8be7740

Please sign in to comment.