0

Im trying make a http request with GET mephod passing params, but it's not working, request is calling the endpoint but not passing search params

let params = new URLSearchParams();
params.set('dt_from', '2017-09-03');
params.set('dt_to', '2017-09-03');
return this.http.get(environment.apiHost + 'reports/report01', {search: params})

1 Answer 1

3

I guess you have forgotten to add import for URLSearchParams

import { URLSearchParams } from '@angular/http';
Sign up to request clarification or add additional context in comments.

2 Comments

@rayashi np,you can mark it if it works might help someone :)
@rayashi You should likely receive type error because of that. See also stackoverflow.com/a/43750374/3731501 . New HttpClient doesn't have this problem.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.