Query Parsing Issue in Service Call Out.

Hi

while passing a query params in Service call out its expect that query params special character to be converted with delimiters.

Like %25 to be converted to %.

But after this call to service call out it is expected to be change but while debugging its is seen that

%25 is converted to %2525.

Is there a way to by pass that extra conversion it has done.

Please find the screens of debugging window of updated or converted query params.

The signature value in query param is AHSX%252FEOA8eHb7Z8joxsWFn%252F8u5Q%253D

And the expected output for the should be : AHSX%2FEOA8eHb7Z8joxsWFn%2F8u5Q%3D

But the output after apigee query params conversion is : AHSX%25252FEOA8eHb7Z8joxsWFn%25252F8u5Q%25253D

The source of truth I found this using online query parser.
https://www.freeformatter.com/url-parser-query-string-splitter.html

screenshot-from-2020-02-21-16-53-18.png

0 4 390
4 REPLIES 4

Instead of passing %25, why not just pass %. ?

It seems like a matter of double encoding. Don't double encode.

If I've misunderstood, maybe you could.... yknow.... explain a little more.... and maybe show the ServiceCallout configuration you're using.

@Dino-at-Google Thanks for the reply.

Only things I am asking here is how to pass '%' sign as query param in a service callout.

Since Every % sign is getting converted with %25 in query param at target server which it seems to me is wrongly converted by middle layer.

According to the HTTP specification, the % must be url-encoded. That's what Apigee does.

The upstream (Receiving) system should url-decode.

This behavior is not special to Apigee. This will be the behavior of any HTTP-compliant system.

Not applicable

I tried the same in the below way and it works as expected. When I am sending %2 it is found in response as %2 instead of %252.

My service callout looks as below.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-1">
    <DisplayName>Service Callout-1</DisplayName>
    <Properties/>
    <Request clearPayload="true" variable="myreq">
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
        <Set>
            <QueryParams>
                <QueryParam name="address">{request.queryparam.test}</QueryParam>
            </QueryParams>
        </Set>
    </Request>
    <Response>calloutResponse</Response>
    <HTTPTargetConnection>
        <Properties>
            <Property name="io.timeout.millis">20000</Property>
        </Properties>
        <URL>http://mocktarget.apigee.net/echo</URL>
    </HTTPTargetConnection>
</ServiceCallout>

and my query param in request and in response as below.

req: https://priyadarshiajitav1990-78651-eval-prod.apigee.net/service-callout1?test=AHSX%2FE

resp:

&address=AHSX%2FE