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;
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
add a comment
|
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
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
add a comment
|
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
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
angular angular2-http angular4-httpclient
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
add a comment
|
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
add a comment
|
2 Answers
2
active
oldest
votes
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.
add a comment
|
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.
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment
|
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.
add a comment
|
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.
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.
answered Jan 14 at 18:17
ReactgularReactgular
29.4k8 gold badges73 silver badges124 bronze badges
29.4k8 gold badges73 silver badges124 bronze badges
add a comment
|
add a comment
|
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.
add a comment
|
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.
add a comment
|
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.
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.
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
add a comment
|
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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