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

Is it just me or is URLSearchParams() being ignored by the HttpService? #59

Closed
moshmage opened this issue Apr 11, 2017 · 1 comment
Closed

Comments

@moshmage
Copy link

So: This is a raw angular2.4 plunkr I found laying about: https://plnkr.co/edit/TTsy3IsY8t0hmo8Z0LaA?p=preview

The same cannot be done using this application (I failed to create a plunkr with the generator-ngx-app);

let search: URLSearchParams = new URLSearchParams();

Object.keys(data).forEach((key: string) => {
    search.set(key, data[key]);
});
console.log(search)
let options: RequestOptions = new RequestOptions({search});

this.http.get(<string>_endpoint, options)

This will make the HTTP call but ignore all the URLSearchParams that are inside options

@moshmage
Copy link
Author

moshmage commented Apr 11, 2017

... it's just me.

I was extending the options with a new request options instead of extending it with a object containing headers ^^'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant