title: Azure API Management returning 200 status without response body
body: <p>I already have checked other solutions available on the forum and this one too
  <a href="https://stackoverflow.com/questions/40428300/rest-api-service-when-called-from-azure-apim-returning-empty-response-body-with">REST API service when called from azure APIM returning empty response body with Status code 200</a></p>
  
  <p>I'm trying to call an authentication service which returns status codes (200,401 and 404)
  If it returns 200 then I want my request to be forwarded to the backend otherwise return only status code back to the client.</p>
  
  <p>This is what I added in my policy</p>
  
  <pre><code>&lt;policies&gt;
  &lt;inbound&gt;
      &lt;base /&gt;
      &lt;check-header name="username" failed-check-httpcode="401" failed-check-error-message="unauthorised" ignore-case="true" /&gt;
      &lt;cors&gt;
          &lt;allowed-origins&gt;
              &lt;origin&gt;*&lt;/origin&gt;
          &lt;/allowed-origins&gt;
          &lt;allowed-methods&gt;
              &lt;method&gt;GET&lt;/method&gt;
              &lt;method&gt;POST&lt;/method&gt;
          &lt;/allowed-methods&gt;
      &lt;/cors&gt;
      &lt;send-request mode="new" response-variable-name="receivedResp" timeout="20" ignore-error="true"&gt;
          &lt;set-url&gt;https://authenticate1.azurewebsites.net/auth&lt;/set-url&gt;
          &lt;set-method&gt;GET&lt;/set-method&gt;
          &lt;set-header name="username" exists-action="override"&gt;
              &lt;value&gt;@(context.Request.Headers.GetValueOrDefault("username",""))&lt;/value&gt;
          &lt;/set-header&gt;
          &lt;set-body /&gt;
      &lt;/send-request&gt;
      &lt;return-response response-variable-name="receivedResp" /&gt;
  &lt;/inbound&gt;
  &lt;backend&gt;
      &lt;base /&gt;
  &lt;/backend&gt;
  &lt;outbound&gt;
      &lt;base /&gt;
  &lt;/outbound&gt;
  &lt;on-error&gt;
      &lt;base /&gt;
  &lt;/on-error&gt;
  </code></pre>
  
  <p>
  Now problem is return is returning received response in all cases, when i added a conditional policy i still was not able to return response received from backend.</p>
  
  <p><strong>Can anyone tell how to check status code and return response received from the server in case of 200 only?</strong></p>