string manipulations

Gandla, Srikanth 1 Reputation point
2021-11-11T18:04:45.863+00:00

How can i change value in request body from lowercase to uppercase or viceverse ??

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,263 questions
Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
279 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Urnun 9,666 Reputation points Microsoft Employee
    2021-11-16T20:26:12.46+00:00

    Hello @Gandla, Srikanth - You'll want to review Transformation Policies in API Management as well as the Policy Expressions feature.

    Specifically, the <set-body> policy and its support for Liquid templates, please refer to: Using Liquid templates with set body

    The Liquid templating language provides a host of operations that'll come in very handy when dealing with data transformations in APIM. Depending on what you're trying to do, the use of Liquid templates may be a lot cleaner approach, here's a basic sample where we're using the Upcase filter on a simple "hello world" text:

    149951-image.png

    For more complex scenarios, you might handle it in a pure, vanilla C# way using the Policy Expressions feature and its support for the System.String & other supporting types & different operations made available by them: https://learn.microsoft.com/en-us/azure/api-management/api-management-policy-expressions#CLRTypes

    I hope this helps, let me know if you had any further questions regarding any of the above.