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’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

Closed
escardin opened this issue Nov 16, 2015 · 2 comments
Closed

Http.request forces all requests to be GET requests #5309

escardin opened this issue Nov 16, 2015 · 2 comments

Comments

@escardin
Copy link

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.

@bpquintanilha
Copy link

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.

robwormald added a commit to robwormald/angular that referenced this issue Nov 20, 2015
robwormald added a commit to robwormald/angular that referenced this issue Nov 20, 2015
robwormald added a commit to robwormald/angular that referenced this issue Nov 20, 2015
robwormald added a commit to robwormald/angular that referenced this issue Nov 20, 2015
Honor method parameter passed to http.request().

Closes angular#5309
robwormald added a commit to robwormald/angular that referenced this issue Nov 20, 2015
Honor method parameter passed to http.request().

Closes angular#5309
robwormald added a commit to robwormald/angular that referenced this issue Nov 20, 2015
Honor method parameter passed to http.request().

Closes angular#5309
robwormald added a commit to robwormald/angular that referenced this issue Nov 20, 2015
Honor method parameter passed to http.request().

Closes angular#5309
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants