Change request message sent to the target server

Hello all, 

I am working on API proxy where when I hit the postman with request body , it is exactly same as Apigee request body. For example,

Existing Code : Client("birthDate":"yy-mm-ddTimeZone")-->Apigee("birthDate":"yy-mm-ddTimeZone")

But I have to change the request when sent to Target Server

Expected Change: Client("birthDate":"yy-mm-ddTimeZone") -->Apigee("birthDateStr":"yy-mm-dd")

I am trying to make this change by assigning the message in Preflow. But I am not sure how exactly I should make changes to send the request.

Can anyone please help with this ?

0 1 145
1 REPLY 1

Hi @priyanka9289 , sounds like you are on the right track. I'd suggest looking at the ExtractVariables policy to save the data you want to keep from the request payload as a variable, before setting the new request payload using and AssignMessage policy (and the variable).

Alternatively you could also use a JavaScript policy as described here, though it doesn't sound like you'll need the for each loop.