Parameters are now immutable , so you must set them when starting new HttpParams so that each set () returns a new instance and applies the changes. Try
const params = new HttpParams() .set('personId', personId);
Here are the docs that cover the headers and URL parameters for 4.3 - https://angular.io/guide/http#headers
Edit: I wanted to update my answer and indicate that you do not have to set parameters when starting the HttpParams class. For example, if you need to set parameters in a for loop or outside of HttpParams initialization, you can do this with
const params = new HttpParams() .set('personId', personId); params = params.set('personName', personName);
As stated in the docs:
The HttpHeaders class is immutable, so each set () returns a new instance and applies the changes.
source share