Can't have a timeout of over 2 minutes with this.http.get?How to increase waiting time for HttpClient request in angular 5?How to increase HTTP request timeout more than 2 minutes in Angular 7?Can't bind to 'ngModel' since it isn't a known property of 'input'Can't bind to 'formGroup' since it isn't a known property of 'form'How do I adjust timeout duration on retry using RxJS?Run ngrx/effect outside of Angular's zone to prevent timeout in ProtractorIE11 Ajax Aborted After 5 MinutesIncrease timeout in Angular 2+ and ASP.NET Core WebAPI application504 Timeout while reading reponse from the server

Going to France with limited French for a day

How do I deal with too many NPCs in my campaign?

Has my MacBook been hacked?

Could Apollo astronauts see city lights from the moon?

In a folk jam session, when asked which key my non-transposing chromatic instrument (like a violin) is in, what do I answer?

How does this circuit start up?

Is it possible to constructively prove that every quaternion has a square root?

Safely hang a mirror that does not have hooks

What are these pixel-level discolored specks? How can I fix it?

Counting most common combination of values in dataframe column

Hilbert's hotel, why can't I repeat it infinitely many times?

To what extent is it worthwhile to report check fraud / refund scams?

Was there a trial by combat between a man and a dog in medieval France?

Wrong result by FindRoot

Hiking with a mule or two?

What is the need of methods like GET and POST in the HTTP protocol?

Social leper versus social leopard

Why does NASA publish all the results/data it gets?

Would Taiwan and China's dispute be solved if Taiwan gave up being the Republic of China?

Writing a letter of recommendation for a mediocre student

Algorithm that spans orthogonal vectors: Python

I reverse the source code, you negate the input!

Does Diablo III have a loot filter?

Where Does VDD+0.3V Input Limit Come From on IC chips?



Can't have a timeout of over 2 minutes with this.http.get?


How to increase waiting time for HttpClient request in angular 5?How to increase HTTP request timeout more than 2 minutes in Angular 7?Can't bind to 'ngModel' since it isn't a known property of 'input'Can't bind to 'formGroup' since it isn't a known property of 'form'How do I adjust timeout duration on retry using RxJS?Run ngrx/effect outside of Angular's zone to prevent timeout in ProtractorIE11 Ajax Aborted After 5 MinutesIncrease timeout in Angular 2+ and ASP.NET Core WebAPI application504 Timeout while reading reponse from the server






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return. Using just the default this.http.get code, I see that the default timeout kicks in after 2 minutes. However when I try to put in a timeout of anything OVER 2 minutes, it fails in that it will never let the timeout be over 2 minutes.



I've tried with 100, 100000 (1.7m) and 114000(1.9m) and those work in that it gets timed out right at those values. But when I try 126000 (2.1m), 180000 (3m) and 1800000 (30m), again I see it times out after 2 minutes.



this.http.get('myUrl')
.timeout(126000)
.map((res: Response) => this.convertResponse(res));


I've also tried it with .timeoutWith(126000, Observable.throw(new Error("Timed out"))) to no avail.










share|improve this question
























  • Were you able to increase the timeout over 2 minutes for making server call using httpClient? I am also working on a similar scenario where one server call takes more than 2 minutes to respond and using this.http.get('url').timeout(180000) did not work.

    – dev
    Mar 28 at 15:43











  • Where does it happen, on your dev machine? If so, are you using the proxy config?

    – Marcos Dimitrio
    Sep 9 at 22:16

















3















My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return. Using just the default this.http.get code, I see that the default timeout kicks in after 2 minutes. However when I try to put in a timeout of anything OVER 2 minutes, it fails in that it will never let the timeout be over 2 minutes.



I've tried with 100, 100000 (1.7m) and 114000(1.9m) and those work in that it gets timed out right at those values. But when I try 126000 (2.1m), 180000 (3m) and 1800000 (30m), again I see it times out after 2 minutes.



this.http.get('myUrl')
.timeout(126000)
.map((res: Response) => this.convertResponse(res));


I've also tried it with .timeoutWith(126000, Observable.throw(new Error("Timed out"))) to no avail.










share|improve this question
























  • Were you able to increase the timeout over 2 minutes for making server call using httpClient? I am also working on a similar scenario where one server call takes more than 2 minutes to respond and using this.http.get('url').timeout(180000) did not work.

    – dev
    Mar 28 at 15:43











  • Where does it happen, on your dev machine? If so, are you using the proxy config?

    – Marcos Dimitrio
    Sep 9 at 22:16













3












3








3


1






My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return. Using just the default this.http.get code, I see that the default timeout kicks in after 2 minutes. However when I try to put in a timeout of anything OVER 2 minutes, it fails in that it will never let the timeout be over 2 minutes.



I've tried with 100, 100000 (1.7m) and 114000(1.9m) and those work in that it gets timed out right at those values. But when I try 126000 (2.1m), 180000 (3m) and 1800000 (30m), again I see it times out after 2 minutes.



this.http.get('myUrl')
.timeout(126000)
.map((res: Response) => this.convertResponse(res));


I've also tried it with .timeoutWith(126000, Observable.throw(new Error("Timed out"))) to no avail.










share|improve this question














My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return. Using just the default this.http.get code, I see that the default timeout kicks in after 2 minutes. However when I try to put in a timeout of anything OVER 2 minutes, it fails in that it will never let the timeout be over 2 minutes.



I've tried with 100, 100000 (1.7m) and 114000(1.9m) and those work in that it gets timed out right at those values. But when I try 126000 (2.1m), 180000 (3m) and 1800000 (30m), again I see it times out after 2 minutes.



this.http.get('myUrl')
.timeout(126000)
.map((res: Response) => this.convertResponse(res));


I've also tried it with .timeoutWith(126000, Observable.throw(new Error("Timed out"))) to no avail.







angular angular2-http angular4-httpclient






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 14 at 17:23









Mike K.Mike K.

2641 gold badge4 silver badges18 bronze badges




2641 gold badge4 silver badges18 bronze badges















  • Were you able to increase the timeout over 2 minutes for making server call using httpClient? I am also working on a similar scenario where one server call takes more than 2 minutes to respond and using this.http.get('url').timeout(180000) did not work.

    – dev
    Mar 28 at 15:43











  • Where does it happen, on your dev machine? If so, are you using the proxy config?

    – Marcos Dimitrio
    Sep 9 at 22:16

















  • Were you able to increase the timeout over 2 minutes for making server call using httpClient? I am also working on a similar scenario where one server call takes more than 2 minutes to respond and using this.http.get('url').timeout(180000) did not work.

    – dev
    Mar 28 at 15:43











  • Where does it happen, on your dev machine? If so, are you using the proxy config?

    – Marcos Dimitrio
    Sep 9 at 22:16
















Were you able to increase the timeout over 2 minutes for making server call using httpClient? I am also working on a similar scenario where one server call takes more than 2 minutes to respond and using this.http.get('url').timeout(180000) did not work.

– dev
Mar 28 at 15:43





Were you able to increase the timeout over 2 minutes for making server call using httpClient? I am also working on a similar scenario where one server call takes more than 2 minutes to respond and using this.http.get('url').timeout(180000) did not work.

– dev
Mar 28 at 15:43













Where does it happen, on your dev machine? If so, are you using the proxy config?

– Marcos Dimitrio
Sep 9 at 22:16





Where does it happen, on your dev machine? If so, are you using the proxy config?

– Marcos Dimitrio
Sep 9 at 22:16












2 Answers
2






active

oldest

votes


















6
















You can not change the web browser's network timeout setting for HTTP requests. The timeout() operator throws a JavaScript error when the timer is reached, but this has nothing to do with the network timeout for communications.



For example; I can use the timeout() operator on any observable.



of("hello").pipe(delay(5000), timeout(1000));


The above will timeout after 1 second.




My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return




The server must transmit a HTTP header and a partial body during the duration of 2-4 minutes. This is required to continue the HTTP connection, and there is nothing the client can do to keep the connection alive.



It is a bad practice for a HTTP request to not complete quickly.



You can either ask the server to start a task, and then poll on an interval to see if the task is complete, or you can use websockets to communicate with the server and remain connected until it is complete.



Both approaches are broad topics and I can't go into more details than that.






share|improve this answer
































    0
















    I don't think it's a problem with the browser's network timeout, since I can make a much longer request using jQuery.ajax(), without even transmitting an HTTP header or a partial body from the backend, and the request is kept alive.



    I didn't get a reply from you in the comments, but I was having this exact issue on my dev machine. I was using the proxy config, and the proxy's default timeout is 120 seconds (2 minutes). If that's your case, you just need to define a higher value in the configuration.




    "/api":
    "target": "http://localhost:3000",
    "secure": false,
    "timeout": 360000




    But I agree with @Reactgular that in most cases, you'll want HTTP requests that return quickly.






    share|improve this answer





























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54186362%2fcant-have-a-timeout-of-over-2-minutes-with-this-http-get%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      6
















      You can not change the web browser's network timeout setting for HTTP requests. The timeout() operator throws a JavaScript error when the timer is reached, but this has nothing to do with the network timeout for communications.



      For example; I can use the timeout() operator on any observable.



      of("hello").pipe(delay(5000), timeout(1000));


      The above will timeout after 1 second.




      My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return




      The server must transmit a HTTP header and a partial body during the duration of 2-4 minutes. This is required to continue the HTTP connection, and there is nothing the client can do to keep the connection alive.



      It is a bad practice for a HTTP request to not complete quickly.



      You can either ask the server to start a task, and then poll on an interval to see if the task is complete, or you can use websockets to communicate with the server and remain connected until it is complete.



      Both approaches are broad topics and I can't go into more details than that.






      share|improve this answer





























        6
















        You can not change the web browser's network timeout setting for HTTP requests. The timeout() operator throws a JavaScript error when the timer is reached, but this has nothing to do with the network timeout for communications.



        For example; I can use the timeout() operator on any observable.



        of("hello").pipe(delay(5000), timeout(1000));


        The above will timeout after 1 second.




        My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return




        The server must transmit a HTTP header and a partial body during the duration of 2-4 minutes. This is required to continue the HTTP connection, and there is nothing the client can do to keep the connection alive.



        It is a bad practice for a HTTP request to not complete quickly.



        You can either ask the server to start a task, and then poll on an interval to see if the task is complete, or you can use websockets to communicate with the server and remain connected until it is complete.



        Both approaches are broad topics and I can't go into more details than that.






        share|improve this answer



























          6














          6










          6









          You can not change the web browser's network timeout setting for HTTP requests. The timeout() operator throws a JavaScript error when the timer is reached, but this has nothing to do with the network timeout for communications.



          For example; I can use the timeout() operator on any observable.



          of("hello").pipe(delay(5000), timeout(1000));


          The above will timeout after 1 second.




          My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return




          The server must transmit a HTTP header and a partial body during the duration of 2-4 minutes. This is required to continue the HTTP connection, and there is nothing the client can do to keep the connection alive.



          It is a bad practice for a HTTP request to not complete quickly.



          You can either ask the server to start a task, and then poll on an interval to see if the task is complete, or you can use websockets to communicate with the server and remain connected until it is complete.



          Both approaches are broad topics and I can't go into more details than that.






          share|improve this answer













          You can not change the web browser's network timeout setting for HTTP requests. The timeout() operator throws a JavaScript error when the timer is reached, but this has nothing to do with the network timeout for communications.



          For example; I can use the timeout() operator on any observable.



          of("hello").pipe(delay(5000), timeout(1000));


          The above will timeout after 1 second.




          My angular 4.3.2 code is calling my back-end service that takes 2-4 minutes to return




          The server must transmit a HTTP header and a partial body during the duration of 2-4 minutes. This is required to continue the HTTP connection, and there is nothing the client can do to keep the connection alive.



          It is a bad practice for a HTTP request to not complete quickly.



          You can either ask the server to start a task, and then poll on an interval to see if the task is complete, or you can use websockets to communicate with the server and remain connected until it is complete.



          Both approaches are broad topics and I can't go into more details than that.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 14 at 18:17









          ReactgularReactgular

          29.4k8 gold badges73 silver badges124 bronze badges




          29.4k8 gold badges73 silver badges124 bronze badges


























              0
















              I don't think it's a problem with the browser's network timeout, since I can make a much longer request using jQuery.ajax(), without even transmitting an HTTP header or a partial body from the backend, and the request is kept alive.



              I didn't get a reply from you in the comments, but I was having this exact issue on my dev machine. I was using the proxy config, and the proxy's default timeout is 120 seconds (2 minutes). If that's your case, you just need to define a higher value in the configuration.




              "/api":
              "target": "http://localhost:3000",
              "secure": false,
              "timeout": 360000




              But I agree with @Reactgular that in most cases, you'll want HTTP requests that return quickly.






              share|improve this answer































                0
















                I don't think it's a problem with the browser's network timeout, since I can make a much longer request using jQuery.ajax(), without even transmitting an HTTP header or a partial body from the backend, and the request is kept alive.



                I didn't get a reply from you in the comments, but I was having this exact issue on my dev machine. I was using the proxy config, and the proxy's default timeout is 120 seconds (2 minutes). If that's your case, you just need to define a higher value in the configuration.




                "/api":
                "target": "http://localhost:3000",
                "secure": false,
                "timeout": 360000




                But I agree with @Reactgular that in most cases, you'll want HTTP requests that return quickly.






                share|improve this answer





























                  0














                  0










                  0









                  I don't think it's a problem with the browser's network timeout, since I can make a much longer request using jQuery.ajax(), without even transmitting an HTTP header or a partial body from the backend, and the request is kept alive.



                  I didn't get a reply from you in the comments, but I was having this exact issue on my dev machine. I was using the proxy config, and the proxy's default timeout is 120 seconds (2 minutes). If that's your case, you just need to define a higher value in the configuration.




                  "/api":
                  "target": "http://localhost:3000",
                  "secure": false,
                  "timeout": 360000




                  But I agree with @Reactgular that in most cases, you'll want HTTP requests that return quickly.






                  share|improve this answer















                  I don't think it's a problem with the browser's network timeout, since I can make a much longer request using jQuery.ajax(), without even transmitting an HTTP header or a partial body from the backend, and the request is kept alive.



                  I didn't get a reply from you in the comments, but I was having this exact issue on my dev machine. I was using the proxy config, and the proxy's default timeout is 120 seconds (2 minutes). If that's your case, you just need to define a higher value in the configuration.




                  "/api":
                  "target": "http://localhost:3000",
                  "secure": false,
                  "timeout": 360000




                  But I agree with @Reactgular that in most cases, you'll want HTTP requests that return quickly.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 14 at 5:49

























                  answered Sep 13 at 23:53









                  Marcos DimitrioMarcos Dimitrio

                  4,1331 gold badge23 silver badges45 bronze badges




                  4,1331 gold badge23 silver badges45 bronze badges































                      draft saved

                      draft discarded















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54186362%2fcant-have-a-timeout-of-over-2-minutes-with-this-http-get%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                      Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript