Update doc to show redirect mode
This commit is contained in:
parent
321d800750
commit
1cd0a5c570
15
README.md
15
README.md
|
@ -146,17 +146,18 @@ 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
|
||||||
|
, body: empty // request body. can be a string, buffer, readable stream
|
||||||
, agent: null // http.Agent instance, allows custom proxy, certificate etc.
|
, agent: null // http.Agent instance, allows custom proxy, certificate etc.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue