I have a API where I want to passthrough some queryparams from request to the target server. However, I want to passthrough only limited set of queryparams. Anything passed additionally, I want to strip it out / ignore it.
What is the best way to do this? Can I do it using just policies and without having to use Javascript?
When I use the assignmessage policy, I tried to all queryparam and copy only the needed queryparams. However of course remove and copy don’t go together and all queryparams are removed.
With just the extra params go through to target.
With optional params go through as blank which I dont want. example: target.com/api?a=&b=1
Yes , You are right. Remove & Copy don’t go together. Same applies for remove & set also.
You need to split the logic into two different Assign Message Policies. Below policies works for your use case. Tested and it works. Possible using just policies without javascript.