'send-request' Policy Statement


How to use the "send-request" Policy statement to call an extra web service for an Azure API service operation?

✍: FYIcenter.com


The "send-request" Policy Statement allows you to call an extra web service and store the response in a given variable.

The "send-request" statement has the following syntax:

<send-request mode="new|copy" response-variable-name="" timeout="60 sec" ignore-error="false|true">  
  <set-header name="" exists-action="override|skip|append|delete">...</set-header>  


  • mode="new (default) | copy" - Indicates whether you want to start with new empty request of take a copy of the "context.Request" object.
  • response-variable-name="" - Specifies a new context variable to store the response object returned from the call.
  • ignore-error="..." - If set to "true" and the call failed, the process continues.

For example, the following inbound policy makes an extra web service call. The response of the call will be stored a context variable called "loginResponse":

  <send-request mode="new" response-variable-name="loginResponse" timeout="20" ignore-error="true">  
    <set-header name="Authorization" exists-action="override">  
      <value>basic dXNlcm5hbWU6cGFzc3dvcmQ=</value>  


'send-one-way-request' Policy Statement

'return-response' Policy Statement

Policy to Control Backend Service

⇑⇑ Microsoft Azure API Management Tutorials

2018-01-13, 3065🔥, 0💬