Is it possible to make a timeout of 3 seconds in a post request ? How ?
My code for the moment
this.http.post(\'myUrl\',
MyData, {headers: Myhe
I modified the answer of Thierry to get it working with the latest release. It is necessary to remove the second parameter of the timeout function. According to a discussion regarding an angular-cli issue, the timeout function always throws a TimeoutError now.
this.http.post('myUrl',
MyData, {headers: Myheaders})
.timeout(3000)
.map(res => res.json())
.subscribe(
data => this.ret = data,
error => console.debug('ERROR', error),
() => console.log('END')
);