Skip to content

Instantly share code, notes, and snippets.

@BadgerCode
Last active May 23, 2019 08:59
Show Gist options
  • Save BadgerCode/cf06e1de4f14d4fcb3f94abe59f6361a to your computer and use it in GitHub Desktop.
Save BadgerCode/cf06e1de4f14d4fcb3f94abe59f6361a to your computer and use it in GitHub Desktop.
Azure API Management debug response
<policies>
<inbound>
<base />
<return-response>
<set-status code="200" />
<set-header name="Content-Type" exists-action="override">
<value>application/json</value>
</set-header>
<set-body>@{
var response = new JObject();
response["AccountReference"] = context.Variables.GetValueOrDefault<string>("AccountReference");
response["GatewayId"] = context.Variables.GetValueOrDefault<string>("GatewayId");
response["Variables"] = JObject.FromObject(context.Variables);
response["MatchedParameters"] = JObject.FromObject(context.Request.MatchedParameters);
response["url"] = JObject.FromObject(context.Request.Url);
return response.ToString();
}</set-body>
</return-response>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment