Update doc to show redirect mode

This commit is contained in:
David Frank 2016-04-06 03:25:16 +08:00
parent 321d800750
commit 1cd0a5c570
1 changed files with 9 additions and 8 deletions

View File

@ -146,18 +146,19 @@ Should be an absolute url, eg `http://example.com/`
### Options
default values are shown, note that only `method`, `headers` and `body` are allowed in `window.fetch`, others are node.js extensions.
default values are shown, note that only `method`, `headers`, `redirect` and `body` are allowed in `window.fetch`, others are node.js extensions.
```
{
method: 'GET'
, headers: {} // request header, format {a:1} or {b:[1,2,3]}
, follow: 20 // maximum redirect count, 0 to not follow redirect
, timeout: 0 // req/res timeout in ms, 0 to disable, timeout reset on redirect
, compress: true // support gzip/deflate content encoding, false to disable
, size: 0 // maximum response body size in bytes, 0 to disable
, body: empty // request body, can be a string or readable stream
, agent: null // http.Agent instance, allows custom proxy, certificate etc.
, headers: {} // request header. format {a:'1'} or {b:['1','2','3']}
, redirect: 'follow' // set to 'manual' to extract redirect headers, `error` to reject redirect
, follow: 20 // maximum redirect count. 0 to not follow redirect
, timeout: 0 // req/res timeout in ms. 0 to disable (os limit still applies), timeout reset on redirect
, compress: true // support gzip/deflate content encoding. false to disable
, size: 0 // maximum response body size in bytes. 0 to disable
, body: empty // request body. can be a string, buffer, readable stream
, agent: null // http.Agent instance, allows custom proxy, certificate etc.
}
```