Skip to content

Commit

Permalink
fix readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
floatdrop committed Apr 6, 2016
1 parent fc57c70 commit 02c52c3
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,31 +121,26 @@ Milliseconds after which the request will be aborted and an error event with `ET
Type: `number`, `function`
Default: `5`

Number of request retries when network errors happens. Delays between retries counts with function `Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 0).

**Note:** `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module).
Number of request retries when network errors happens. Delays between retries counts with function `1000 * Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 0).

Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry).

##### callback(error, data, response)

Function to be called when error or data are received. If omitted, a promise will be returned.

###### error

`Error` object with HTTP status code as `statusCode` property.
**Note:** if `retries` is `number`, `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module).

<<<<<<< HEAD
###### data
=======
###### followRedirect

Type: `boolean`
Default: `true`

Defines if redirect responses should be followed automatically.

>>>>>>> b3cd961... Added option to toggle automatic following redirects
##### callback(error, data, response)

Function to be called when error or data are received. If omitted, a promise will be returned.

###### error

`Error` object with HTTP status code as `statusCode` property.

The data you requested.

Expand Down

0 comments on commit 02c52c3

Please sign in to comment.