Reputation: 1025
I would like to copy the request object (headers,params,body) as payload of response and send it back. Is there good way or suggested way to do this?
Upvotes: 1
Views: 1197
Reputation: 628
You can try using the AssignMessage
policy to copy the request object and assign it to the response object. Example policy:
<AssignMessage name="CopyRequestToResponse">
<AssignTo type="response" createNew="false">response</AssignTo>
<Copy source="request"/>
</AssignMessage>
This policy should execute in a TargetEndpoint
response flow as the scope of response
is Target Response. You can find the Apigee documentation for the policy and variable scopes here:
http://apigee.com/docs/api-services/content/generate-or-modify-messages-using-assignmessage http://apigee.com/docs/api-services/api/variables-reference
Upvotes: 4