I have a criteria object for which some attributes can be null, if I don't do anything the query string include those like &p=undefined
which is not desirable since at the WebApi these come as"null"
instead of null
So given this in the Angular client
return this._http
.get<ExposureDifference[]>(AppSettings.ExposureRunDataQueryString, {params : <any>criteria, withCredentials: true})
.catch<any, ExposureDifference[]>(this._trace.handleError("GET " + AppSettings.ExposureRunDataQueryString + criteria, []))
.finally(() => this.isLoading = false);
I could get the query string as
http://localhost:63037/api/exposureRuns/data/?id=3&secsymb=undefined&fund=EL&esectype=SWAP_CDS
Is there a way to exclude the undefined parameters from the query string?