Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Apigee X Request URL query parameter encoding issue

Hi,

Greeting to the community!

I've encountered an issue with Apigee X platform where the request urls are getting encoded incorrectly.

Example request I tried from postman is : GET https://api.xyz.com/example?test=123+abc 

The url seems to be consistent in Load Balancer logs, and as soon as it reaches Apigee X, in trace session logs,  I see it is encoded as https://api.xyz.com/example?test=123%20abc instead of https://api.xyz.com/example?test=123%2Babc  . 

Which is then forwarded incorrectly to the target server.

I'm currently not sure if this is due to Apigee or do I need to add some additional property in proxy configuration. Have anyone faced a similar issue and any possible resolution for the same?

Thanks,

Solved Solved
0 3 586
1 ACCEPTED SOLUTION

The IETF standard regarding encoding characters within query strings with HTTP urls, is... maybe not easily discoverable . The relevant spec is RFC 3986. 

Section 2.2 of that specification  says that plus characters must be % encoded, if you want to transmit them.  

dchiesa1_1-1734982619467.png

 

It seems like you want to transmit a plus, not a space.  So percent-encode it before you send it. 


@Pratyush_ wrote:

I see it is encoded as https://api.xyz.com/example?test=123%20abc


This is correct behavior, based on what you're telling me. 

BTW, this is the advice Gemini has to offer on the subject: 

dchiesa1_2-1734982881423.png

 

 

View solution in original post

3 REPLIES 3