-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
The current requests rely on the timeouts defined in the browser or in the OS. When executing requests, I'd like to be able to set custom timeouts to the requests made by superagent:
https://visionmedia.github.io/superagent/#timeouts
request
.get('/big-file?network=slow')
.timeout({
response: 5000, // Wait 5 seconds for the server to start sending,
deadline: 60000, // but allow 1 minute for the file to finish loading.
})
.then(res => {
/* responded in time */
}, err => {
if (err.timeout) { /* timed out! */ } else { /* other error */ }
});
This could be passed as options to the hyperwallet constructor or functions. Alternatively we could inject our own instance of superagent which would also give the ability to use custom plugins for superagent
johnnonolan
Metadata
Metadata
Assignees
Labels
No labels