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

Remove queryparam after assign message to payload

pxzxz1
New Member

Hello Apigeeks

<AssignMessage async="false" continueOnError="false" enabled="true" name="Payload">
    <DisplayName>Payload</DisplayName>
    <Set>
        <Payload contentType="application/json">
            {"bookid":"{request.queryparam.bookid}"}
        </Payload>
    </Set>
    <Remove>
        <QueryParams>
            <QueryParam name="bookid"/>
        </QueryParams>
    </Remove>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

Above, I set json payload from the queryparam and removed them from queryparam. Next, I print proxy request with javascript policy.

var req_request_uri = context.getVariable('proxy.url');
print(req_request_uri);

Result is not as expected. Supposingly, it only returns without the queryparam since I already removed them.

10075-screenshot.jpg

0 4 785
4 REPLIES 4