vue-resource icon indicating copy to clipboard operation
vue-resource copied to clipboard

timeout working ?

Open sblum51 opened this issue 6 years ago • 1 comments

Hello ! I have an issue with the timeout in request. I do this.$resource('api/validation', {}, {}, {timeout: 250}) The "timeout" is well caught by the the Promise as error, it's OK. But on server side the request is received. I think the vue-resource triggers timeout but it's not abort..

Thanks for your help

sblum51 avatar Aug 16 '18 20:08 sblum51

Hello @guizmo51 , yes it is. I used this cod

this.$http .post("urlToServer", objJson, { timeout: 100, emulateJSON: true, emulateHTTP: true }) .then(res => res.json()) .then( data => { // EveryThing's ok console.log(JSON.stringify(data)); }, err => { //Treat timeout error console.log(JSON.stringify(data)); } );

Don't forget to change the variables!

teuzinPereira avatar Sep 14 '18 03:09 teuzinPereira