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 ### 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' method: 'GET'
, headers: {} // request header, format {a:1} or {b:[1,2,3]} , headers: {} // request header. format {a:'1'} or {b:['1','2','3']}
, follow: 20 // maximum redirect count, 0 to not follow redirect , redirect: 'follow' // set to 'manual' to extract redirect headers, `error` to reject redirect
, timeout: 0 // req/res timeout in ms, 0 to disable, timeout reset on redirect , follow: 20 // maximum redirect count. 0 to not follow redirect
, compress: true // support gzip/deflate content encoding, false to disable , timeout: 0 // req/res timeout in ms. 0 to disable (os limit still applies), timeout reset on redirect
, size: 0 // maximum response body size in bytes, 0 to disable , compress: true // support gzip/deflate content encoding. false to disable
, body: empty // request body, can be a string or readable stream , size: 0 // maximum response body size in bytes. 0 to disable
, agent: null // http.Agent instance, allows custom proxy, certificate etc. , body: empty // request body. can be a string, buffer, readable stream
, agent: null // http.Agent instance, allows custom proxy, certificate etc.
} }
``` ```