2.9.0 • Published 6 years ago
fetchx v2.9.0
fetchx
Add some extra options to fetch
add timeout
let url = 'http://httpbin.org/delay/10'
fetchx(url, {timeout:3000})
.catch(e => {
assert.equal(e, 'timeout')
})
change url's protocol and host
let url = 'https://no-such-host.com/status/200'
fetchx(url, {forceServer: 'http://httpbin.org'})
.then(resp => {
assert.equal(resp.status, 200)
assert.equal(resp.url, 'http://httpbin.org')
})
provide fallback servers
let url = 'https://no-such-host.com/status/200'
fetchx(url, {fallbackServers: ['http://another-no-such-host.com', 'http://httpbin.org']})
.then(resp => {
assert.equal(resp.status, 200)
assert.equal(resp.url, 'http://httpbin.org/status/200')
})
2.9.0
6 years ago
2.8.0
6 years ago
2.7.0
6 years ago
2.6.0
7 years ago
2.5.0
7 years ago
2.4.0
8 years ago
2.3.0
8 years ago
2.2.0
8 years ago
2.1.0
8 years ago
2.0.0
8 years ago
1.2.0
8 years ago
1.1.3
8 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago