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] RequestOptions is necessary for params (introduced in 4.0.0-beta.0) #14100

Closed
cexbrayat opened this issue Jan 25, 2017 · 1 comment
Closed

Comments

@cexbrayat
Copy link
Member

cexbrayat commented Jan 25, 2017

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
We can pass options to an HTTP call with http.get(url, {search: searchParams}), but the we can't with the newly introduced params that replaces the deprecated search (#13338 first released in 4.0.0-beta.0).

For params, we have to wrap it in a RequestOptions object: http.get(url, new RequestOptions({params: searchParams})).

Fixed in #14101

Expected behavior
We should be able to pass the options directly without wrapping http.get(url, {params: searchParams}) as we do for the other options.

  • Angular version: 4.0.0-beta.4

  • Browser: all

  • Language: all

cexbrayat added a commit to cexbrayat/angular that referenced this issue Jan 25, 2017
`params` has been introduced in 4.0.0-beta.0

Before:

    http.get(url, new RequestOptions({params: searchParams}))

After:

    http.get(url, {params: searchParams})

Fixes angular#14100
mhevery pushed a commit that referenced this issue Feb 2, 2017
`params` has been introduced in 4.0.0-beta.0

Before:

    http.get(url, new RequestOptions({params: searchParams}))

After:

    http.get(url, {params: searchParams})

Fixes #14100

PR Close #14101
mhevery pushed a commit that referenced this issue Feb 3, 2017
`params` has been introduced in 4.0.0-beta.0

Before:

    http.get(url, new RequestOptions({params: searchParams}))

After:

    http.get(url, {params: searchParams})

Fixes #14100

PR Close #14101
mhevery pushed a commit to mhevery/angular that referenced this issue Feb 3, 2017
`params` has been introduced in 4.0.0-beta.0

Before:

    http.get(url, new RequestOptions({params: searchParams}))

After:

    http.get(url, {params: searchParams})

Fixes angular#14100

PR Close angular#14101
asnowwolf pushed a commit to asnowwolf/angular that referenced this issue Aug 11, 2017
`params` has been introduced in 4.0.0-beta.0

Before:

    http.get(url, new RequestOptions({params: searchParams}))

After:

    http.get(url, {params: searchParams})

Fixes angular#14100

PR Close angular#14101
juleskremer pushed a commit to juleskremer/angular that referenced this issue Aug 28, 2017
`params` has been introduced in 4.0.0-beta.0

Before:

    http.get(url, new RequestOptions({params: searchParams}))

After:

    http.get(url, {params: searchParams})

Fixes angular#14100

PR Close angular#14101
@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 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant