Closed harry671003 closed 7 years ago
When passed a query string that contains special characters, eg: { , the url is being encoded twice.
let filter = { Field: 'Name', Value: 'Alex', Operator: 'Equals' }; let searchParams: URLSearchParams = new URLSearchParams(); searchParams.set('filter', JSON.stringify(filter)); this.authHttp.get( apiUrl, new RequestOptions({ headers: additionalHeaders, search: searchParams }) );
The query string is filter= {Field: 'Name', Value: 'Alex', Operator: 'Equals'}
filter= {Field: 'Name', Value: 'Alex', Operator: 'Equals'}
Here { becomes %7B, before being passed to authHttp.get and inside sendRequest the % will again be encoded to %25 resulting in %257B
{
%7B
authHttp.get
sendRequest
%
%25
%257B
@harry671003 Just fixed this and uploaded again. Can you please verify?
@sureshchahal Just verified this. This works perfectly. Thanks!
When passed a query string that contains special characters, eg: { , the url is being encoded twice.
The query string is
filter= {Field: 'Name', Value: 'Alex', Operator: 'Equals'}
Here
{
becomes%7B
, before being passed toauthHttp.get
and insidesendRequest
the%
will again be encoded to%25
resulting in%257B