Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The possibility of setting Timeouts with HttpClient #34421

Open
swirlsky opened this issue Dec 16, 2019 · 9 comments
Open

The possibility of setting Timeouts with HttpClient #34421

swirlsky opened this issue Dec 16, 2019 · 9 comments
Labels
area: common/http feature: in backlog Feature request for which voting has completed and is now in the backlog feature Issue that requests a new feature
Milestone

Comments

@swirlsky
Copy link

馃殌 feature request

Relevant Package

This feature request is for @angular/common/http

Description

Angular's [HttpClient](https://angular.io/guide/http) has no timeout feature. Using alternative solutions like HTTPInterceptors or RxJS for this purpose a connection timeout functionality cannot be achieved. See: https://stackoverflow.com/questions/59348500/is-there-an-http-connection-timeout-in-client-side-js-angular

Describe the solution you'd like

Angular's HttpClient could use and expose [XMLHttpRequest.timeout](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout) that would make this possible.

Describe alternatives you've considered

HTTPInterceptors, RxJS timeouts, custom HTTP client implementation
@ngbot ngbot bot added this to the needsTriage milestone Dec 16, 2019
@alxhub alxhub added the feature Issue that requests a new feature label Jan 31, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jan 31, 2020
@alxhub
Copy link
Member

alxhub commented Jan 31, 2020

Agreed. If anyone wants to send a PR, that would be awesome 馃槃

@daftfox
Copy link

daftfox commented Apr 3, 2020

I can pick this up. Seems like a good issue to start with since I'd like to become a regular contributor.

daftfox added a commit to daftfox/angular that referenced this issue Apr 16, 2020
Http client allows an optional timeout option to be passed.
An error will be emitted when no response is received within the allotted interval.
This reflects XMLHttpRequest behaviour that is standard in all modern browsers.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout

This is behaviour that has been available for 'regular' js xhr requests, but has
not yet been implemented in Angular. Alternatives such as interceptors, RxJS
or custom client implementation don't offer the same behaviour in a neat package.

I have noticed that a lot of pre-existing code was modified by the formatter,
but I hope this doesn't rustle any jimmies.

fixes angular#34421
daftfox added a commit to daftfox/angular that referenced this issue Apr 16, 2020
Http client allows an optional timeout option to be passed.
An error will be emitted when no response is received within the allotted interval.
This reflects XMLHttpRequest behaviour that is standard in all modern browsers.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout

This is behaviour that has been available for 'regular' js xhr requests, but has
not yet been implemented in Angular. Alternatives such as interceptors, RxJS
or custom client implementation don't offer the same behaviour in a neat package.

I have noticed that a lot of pre-existing code was modified by the formatter,
but I hope this doesn't rustle any jimmies.

fixes angular#34421
daftfox added a commit to daftfox/angular that referenced this issue Apr 17, 2020
Http client allows an optional timeout option to be passed.
An error will be emitted when no response is received within the allotted interval.
This reflects XMLHttpRequest behaviour that is standard in all modern browsers.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout

This is behaviour that has been available for 'regular' js xhr requests, but has
not yet been implemented in Angular. Alternatives such as interceptors, RxJS
or custom client implementation don't offer the same behaviour in a neat package.

I have noticed that a lot of pre-existing code was modified by the formatter,
but I hope this doesn't rustle any jimmies.

fixes angular#34421
daftfox added a commit to daftfox/angular that referenced this issue Apr 17, 2020
Http client allows an optional timeout option to be passed.
An error will be emitted when no response is received within the allotted interval.
This reflects XMLHttpRequest behaviour that is standard in all modern browsers.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout

This is behaviour that has been available for 'regular' js xhr requests, but has
not yet been implemented in Angular. Alternatives such as interceptors, RxJS
or custom client implementation don't offer the same behaviour in a neat package.

fixes angular#34421
@daftfox
Copy link

daftfox commented Apr 17, 2020

Forget about the first PR, I fudged that up with some git shenanigans. Inexperience dealing witht he angular repo and forks I reckon.

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Jun 4, 2021
@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 4, 2021

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 26, 2021

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Jun 26, 2021
daftfox added a commit to daftfox/angular that referenced this issue Jul 7, 2021
Http client allows an optional timeout option to be passed.
An error will be emitted when no response is received within the allotted interval.
This reflects XMLHttpRequest behaviour that is standard in all modern browsers.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout

This is behaviour that has been available for 'regular' js xhr requests, but has
not yet been implemented in Angular. Alternatives such as interceptors, RxJS
or custom client implementation don't offer the same behaviour in a neat package.

fixes angular#34421
@alxhub alxhub moved this from Inbox to Backlog in Feature Requests Jul 15, 2021
@petebacondarwin petebacondarwin added feature: in backlog Feature request for which voting has completed and is now in the backlog and removed feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature: votes required Feature request which is currently still in the voting phase labels Oct 10, 2021
@harikvpy
Copy link

+1

1 similar comment
@Rzassar
Copy link

Rzassar commented Mar 12, 2023

+1

@space11
Copy link

space11 commented Apr 20, 2023

+1 Is there still a chance for this to be implemented?

@anymos
Copy link

anymos commented Jun 12, 2023

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage. --> crazy !!! it is so obvious that it shall be implemented, ofc no body vote ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: common/http feature: in backlog Feature request for which voting has completed and is now in the backlog feature Issue that requests a new feature
Projects
10 participants