Reputation: 143
I am trying to send query parameters with a get request. This code always has an empty query {}. What am I missing?
let p = new HttpParams().set('Test', "7878");
return this.http
.get<Response>(environment.baseAPIUrl + route,
{
withCredentials: false,
headers: requestHeaders,
params: p,
responseType,
observe: observe as 'body'
}
);
Upvotes: 0
Views: 423
Reputation: 19381
Basically your use of HttpParams
seems okay and it's working for me.
Open my Stackblitz Example:
just note, that the error-message (1) will not include the url-parameters
Upvotes: 1