How do see full request/response body in the Trace UI?

8 3 9,079

Be default, Apigee will not display the full request/response payload within the Trace UI as it can be quite large at times. However, if you wish to see the full payload for either of these, you can do so by adding an AssignMessage policy within the respective request/response flow that assigns the request.content or response.content variable to another variable. Here's an example.

<AssignMessage async="false" continueOnError="false" enabled="true" name="GetFullRequestPayload">
    <DisplayName>GetFullRequestPayload</DisplayName>
    <FaultRules/>
    <Properties/>
    <AssignVariable>
        <Name>reqpayload</Name>
        <Value/>
        <Ref>request.content</Ref>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

Once the request.content or response.content variables are accessed, the full variable value will be displayed in Trace.

Comments
sgilson
Participant V

Hi Dave,

Can you expand on what you mean by "Once the request.content or response.content variables are accessed"? Do you mean by adding another policy, such as AssignMessage, that references "reqpayload'?

Stephen

Not applicable

Hi Stephen,

Yes. By accessed, I mean using another policy, e.g. AssignMessage, JavaScript, etc. that makes reference to the request.content or response.content variable depending upon the payload one would like to see.

Dave

kurtkanaskie
Staff

Thanks Dave, exactly what I needed, I just use this AssignMessage throughout my flow with enabled true or false to grab debug information as needed.

Version history
Last update:
‎04-17-2015 03:54 PM
Updated by: