how to remove query param?

Not applicable

Hi,

http:/url?isCheck=123;

i want to remove query parameter in url isCheck=123;

i tried like this

var apikey = 'isCheck';

context.removeVariable("request.queryparam." + apikey);

its not working

Please let me know if i am doing wrong

Solved Solved
2 3 5,115
2 ACCEPTED SOLUTIONS

Hi @Guru Venkatesh

You can do it via Assign Message Policy - Remove

Or

If you are trying to remove the qp from going to the target, then you need to create a Javascript policy

context.setVariable("target.copy.pathsuffix", false);

NOTE: Make sure you put the JS policy in the Target Request flow. There are many community posts regarding target.copy.pathsuffix

View solution in original post

Not applicable

Hi ,

Please use assign message policy to remove the query param from the requests.Here instead of apikey please use isCheck variable.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<AssignMessage async="false" continueOnError="false" enabled="true" name="remove-query-param-apikey">

<DisplayName>Remove Query Param apikey</DisplayName>

<Remove> <QueryParams> <QueryParam name="apikey"/> </QueryParams> </Remove> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>

<AssignTo createNew="false" transport="http" type="request"/>

</AssignMessage>

View solution in original post

3 REPLIES 3

Hi @Guru Venkatesh

You can do it via Assign Message Policy - Remove

Or

If you are trying to remove the qp from going to the target, then you need to create a Javascript policy

context.setVariable("target.copy.pathsuffix", false);

NOTE: Make sure you put the JS policy in the Target Request flow. There are many community posts regarding target.copy.pathsuffix

Hi

Sai Saran Vaidyanathan,

Thank you for update

Not applicable

Hi ,

Please use assign message policy to remove the query param from the requests.Here instead of apikey please use isCheck variable.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<AssignMessage async="false" continueOnError="false" enabled="true" name="remove-query-param-apikey">

<DisplayName>Remove Query Param apikey</DisplayName>

<Remove> <QueryParams> <QueryParam name="apikey"/> </QueryParams> </Remove> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>

<AssignTo createNew="false" transport="http" type="request"/>

</AssignMessage>