Home > Net >  Liquid body inside the return response policy
Liquid body inside the return response policy

Time:01-09

Does anyone know how to access the request body from inside the <set-body template = "liquid"> statement when using the <return response> policy? When I do like this the body seem to be empty:

<inbound>
    <base />
    <set-header name="Content-Type" exists-action="override">
        <value>application/json</value>
    </set-header>
    <return-response>
        <set-status code="200" reason="OK" />
        <set-header name="Content-Type" exists-action="override">
            <value>application/json</value>
        </set-header>
        <set-body template="liquid">
            {
            "name":"{{body.firstname}}"
            }
            
        </set-body>
    </return-response>
</inbound>

The request body is:

{"firstname" : "John Doe"}`

Expected result would be:

{"name":"John Doe"}

The result is:

{"name":""}

CodePudding user response:

Microsoft support told me that the policy return-response enter image description here

  • Related