Transforming GET to POST in assign message but in Route rule condition it is matching request.verb=POST not to request.verb=GET.

I'am making request as GET using query prams and transforming data GET to POST in GET Flow to back end using Assign message, but in route rule condition it matching to POST condition.

it is for GET conditon flow:

<Condition>(proxy.pathsuffix MatchesPath "/") and (request.verb = "GET")</Condition>

it is for POST conditon flow

<Condition>(proxy.pathsuffix MatchesPath "/") and (request.verb = "POST")</Condition>

RouteRules:

<RouteRule name="yyyy">

<TargetEndpoint>yyyy</TargetEndpoint>

<Condition>(request.verb = "GET") and (proxy.pathsuffix MatchesPath "/")

</Condition>

</RouteRule>

<RouteRule name="default">

<TargetEndpoint>default</TargetEndpoint>

<Condition>(request.verb = "POST") and (proxy.pathsuffix MatchesPath "/")

</RouteRule>

Like above described i need in that way will yo please help me on this above case@Siddharth Barahalikar @Dino-at-Google @Dino @Girish Gajria.

0 4 401
4 REPLIES 4

Once you change the verb to POST, the flow variable request.verb becomes POST. Before changing the value of verb you can save the existing value of request.verb to another variable (for ex requestVerb) using assignmessage policy. Ideally, this policy should be first policy in proxy endpoint preflow.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SaveVerb">
    <DisplayName>AM-SaveVerb</DisplayName>
    <Properties/>
    <AssignVariable>
        <Name>requestVerb</Name>
        <Ref>message.verb</Ref>
    </AssignVariable>    
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

Use newly created variable (requestVerb) in conditions.

<Condition>(requestVerb = "GET") and (proxy.pathsuffix MatchesPath "/")

Why it has to be AM-SaveVerb this policy should be first policy in proxy endpoint preflow. Can I put in Get flow which I have created for GET to POST

you need to save the verb before changing the verb. How it works in your proxy is up to you. Putting in the preflow is easy; will always work. It's up to you how you construct things, though.

Ok Thank you for the reply.