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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http.request forces all requests to be GET requests #5309
Comments
Hi, just to add that it only happens when you pass an url as a parameter.If you pass a request, it makes use of the options passed to create the Request instance. |
Honor method parameter passed to http.request(). Closes angular#5309
Honor method parameter passed to http.request(). Closes angular#5309
Honor method parameter passed to http.request(). Closes angular#5309
Honor method parameter passed to http.request(). Closes angular#5309
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I was writing an authentication wrapper for http and I am passing all my methods through http.request since I do not have (or want) access to base options or the mergeOptions function.
http.request passes RequestMethods.Get to all calls to mergeOptions, which then overwrites my passed method of Post.
https://github.com/angular/angular/blob/master/modules/angular2/src/http/http.ts#L106
The default method is Get in the base options, so passing Get is redundant, and the arguments to mergeOptions should be rearranged so that method is optional.
The text was updated successfully, but these errors were encountered: