Reputation: 346
I have imported an API to Azure APIM. I have to specify the header details on APIM. May I know, how can I do this ?
Note : I have tried adding policy for that API as mentioned on below URL, but this is static value. For my case I need to pass dynamic values/different values to header. https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/api-management/api-management-sample-send-request.md
Thanks, Infaaz
Upvotes: 2
Views: 3579
Reputation: 679
You can have dynamic headers in your APIM policy. We support expressions in policies
<set-header name="x-request-context-data" exists-action="override">
<value>@(context.User.Id)</value>
</set-header>
from sample
please take a look at everything that is exposed on context object policy expressions context object
You can read about it Set HttpHeader policy
Upvotes: 1