AssignMessage Policy and HTTP Content-Length Header

We have a Proxy Endpoint which accepts application/json in a POST request. The Target Endpoint uses an ExtractVariables policy for use by an AssignMessage policy, which builds an application/x-www-form-urlencoded request for POSTing to the target server.

The target server is frequently responding with 400 status; however, the exact same request will often succeed if retried. I suspect it may be either a missing Content-Length header being sent or an incorrect value for the header.

Does anyone know how to view the actual bytes getting sent over the connection? Tracing in the UI is leaving me suspicious about what is actually getting sent.

Has anyone seen an example of how to calculate the Content-Length as part of an AssignMessage policy? I looked through some of the examples on GitHub, but didn't see what I'm looking for.

I am at a complete loss right now, so any thoughts at all would help.

Thanks!

0 2 478
2 REPLIES 2

jbradley
Participant I

Have you tried downloading the trace log, after a trace session? It’s fairly verbose, and might give you an idea of what is happening.

I have looked at some trace logs downloaded from the UI; however, it seems to be just the XML representation of what I see in the Trace Session.

I should add we are using the on-premises version, not the hosted version. I'm not sure if that makes a difference or not.

I just added a MessageLogging policy to the Proxy PostClientFlow and another to the Target Request PostFlow. We also managed to capture a few interactions with a substituted Target; the production Target is TLS, so no visibility and thus the substitute. I did not notice any issues with the request to the Target.

The Target is returning AkamaiGHost in the server header on failure. Successful responses are returning nginx in the server header. Not sure if that means anything.

Thanks for any ideas!