Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Can we use set-query-parameter policy inside send-request policy? -No

Several times you come across a situation where you should use send-request Policy to make use of an external service to perform complex processing functions and return data to the API management service that can be used for further policy processing.

The send-request policy looks like this:

basic dXNlcm5hbWU6cGFzc3dvcmQ=



Now if you want to use Query String Parameters in the URL under set-url policy used above using set-query-parameter policy then it is not allowed and you will not be able to even save your configured policy. Generally, we get confused and try to make use of this policy inside send-request policy but set-query-parameter policy is used to add, replace value of, or deletes request query string parameter. It Can be used to pass query parameters expected by the backend service which are optional or never present in the request according to this link
Now the question is how to pass query string parameters? It’s very simple and logical, we can make use of APIM variables in this scenario.

Firstly, setting the variables with some values:

And secondly making use of these variables inside send-request policy:


Refer this link for more details

Please let me know your queries.

Happy Coding!

Share the post

Can we use set-query-parameter policy inside send-request policy? -No


Subscribe to Msdn Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The Msdn Blogs.

Get updates delivered right to your inbox!

Thank you for your subscription