how can i remove %2c from url, after inserted by ...AssignMessage?

Not applicable

Hi friends i am new to Apigee development.

I am making an API call with query parameters.

<Add>
  <QueryParams>
    <QueryParam name="GEOBOUNDS">29,-100,28,-111</QueryParam>
  </QueryParams>
</Add>

But after the call my commas got replaced by %2c i am getting this 29%2c-100%2c28%2c-111

how can i replace %2c with ','

i already tried replace method of javascript, but no success.

Please help

0 3 4,304
3 REPLIES 3

Hi @sharique

Can you explain what you mean by "after the call"?

At that point do you wish to unescape the %2C ? In the API Proxy? AFTER the outbound call has been made? What purpose would that serve? What problem are you encountering?

The comma is not a reserved character for query params, so it is not required that the comma be encoded when present in a query param. Nevertheless, JavaScript's encodeURIComponent() does encode the comma as %2C, and often browsers (such as the current Firefox) will also encode the comma. This shouldn't present a problem as backends can easily decode the parameters, as well.

Thanks @Dino,

let me explain my situation in a more clear way.

I am using an AssignMessage policy to add query parameters in any request url.

1547-apigee2.jpg

My request url with query parameters

1548-request.jpg

Here now the apigee replaces ',' with %2C then sends the request url to target url.

1551-apigee.png

i just want to remove %2C from the request url.

i tried

(1).replace in javascript file.

(2) decodeURIComponent

but no success.

thanks for your response.

Yes, I think I understand what you are asking. I am clear.

What I am telling you is:

The backend system needs to call decodeURIComponent() or the equivalent, on the inbound query string. The backend system is in error.

I understand what you want Apigee Edge to do: you want comma and not %2C. I am telling you that Apigee Edge is behaving normally and correctly, and it complies with the IETF specs. Your backend system is not correctly handling input which is valid. The backend needs to be corrected.