in Education by
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: Myheaders}) .map(res => res.json()) .subscribe( data => this.ret = data, error => console.debug('ERROR', error), () => console.log('END') ); JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can use the timeout operator like this: this.http.post('myUrl', MyData, {headers: Myheaders}) .timeout(3000, new Error('timeout exceeded')) .map(res => res.json()) .subscribe( data => this.ret = data, error => console.debug('ERROR', error), () => console.log('END') );

Related questions

0 votes
    @RequestMapping annotation is used to map a HTTP request method (GET or POST) to a specific class or method in the ... which will handle the respective request. A. True B. False...
asked Nov 8, 2022 in Education by JackTerrance
0 votes
    I am a very novice C# person so please dont be too hard on me Im trying to make a post request ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    I want to get the search result using scrapy post request after giving the input to CP Number as 16308 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
0 votes
    I am trying to calculate the progress of a file upload, so I was using Superagent. I was able to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    This is a cURL function that can send or retrieve data. It should work with any PHP app that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I am new to jmeter. I have been experimenting on creating a jmeter script manually by inspecting the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 1, 2022 in Education by JackTerrance
0 votes
    first of all,i am fairly new with spring mvc so .. how springmvc find the right class to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I am working on my first Android Application. What I am trying to do is a POST request to a REST ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    so with ng2 rc.6 I am getting an error of: Uncaught (in promise) Error: (SystemJS) SyntaxError: ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I'm certain I'm missing something obvious, but the gist of the problem is I'm receiving a PNG ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    How can I transform QraphQl query to HTTP get request for example http://localhost:4000/? query GetClient { ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    When dealing with mobile clients it is very common to have multisecond delays during the transmission of HTTP ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I have the following code (just as a test) and I want to create an HTTP proxy using EventMachine. The code below ... , data, b].inspect end conn.on_data do |data| @buffer...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Can you help me out with this program? I am unable to run this code. varx http = require('http'); exports.handler ... + eventa.url); } Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
...