Skip to content

Commit

Permalink
update REAEME.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Cap32 committed Dec 24, 2017
1 parent e44e4b8 commit dc7b617
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@
[![dependencies Status](https://david-dm.org/cap32/fetch-extra/status.svg)](https://david-dm.org/cap32/fetch-extra)
[![License](https://img.shields.io/badge/license-MIT_License-blue.svg?style=flat)](https://github.com/Cap32/fetch-extra/blob/master/LICENSE)

Extra features for whatwg fetch and Request, including:

- Added query option
- Body could be json object
- Could resolve json (or text, buffer, etc) instead of response object
- Support Node.js
- Added timeout option
- Enhanced `Resquest#clone()`
- Added `Resquest#fetch()`
- Support transformers
- And so on...
Extra features for whatwg fetch and Request like `query` option, JSON `body` option, timeout, `transformers`


## Table of Contents
Expand Down Expand Up @@ -62,14 +52,19 @@ $ yarn add fetch-extra
<a name="fetchextra"></a>
## fetchExtra

```js
import { fetchExtra } from 'fetch-extra';
import { fetch } from 'fetch-extra'; /* or */
```

##### Syntax

> Promise\<Response\> fetchExtra(...options)
`...options` \<...String|Object|RequestExtra\>

- If `options` is a string, it is treated as a `URL`
- If `options` is a object, it is treated as `RequestExtra` options. Checkout below for detail
- If `options` is a object, it is treated as `RequestExtra` options. Checkout below for detail. All [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) options are supported

Later `options` will similarly overwrite earlier ones.

Expand Down Expand Up @@ -105,13 +100,18 @@ For more extra options and usages, please checkout below.
<a name="requestextra"></a>
## RequestExtra

```js
import { RequestExtra } from 'fetch-extra';
import { Request } from 'fetch-extra'; /* or */
```

##### Syntax

> \<RequestExtra\> new RequestExtra(...options)
`...options` \<...String|Object|RequestExtra\>

All options usages are the same with `fetchExtra` options.
All options are the same with `fetchExtra`.

##### Description

Expand Down

0 comments on commit dc7b617

Please sign in to comment.