Skip to content

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

Closed

Description

@escardin

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.

Activity

  1. bpquintanilha commented on Nov 18, 2015

    @bpquintanilha

    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.

  2. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  3. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions