Web Connection
Post Data missing on request from WC Handler
Gravatar is a globally recognized avatar based on your email address. Post Data missing on request from WC Handler
  Rodney
  All
  Nov 13, 2024 @ 04:52am

Hi Rick

I am having some issues on a rest server I have setup, where the form variables (post buffer) are empty.

This is happening from a client webhook which I have configured.

If I post the data via Postman or from WC http it works 100%.

I set up a mock server on Postman and post from the webhook data is received 100% as below:

x-forwarded-for: "xxxxxxxxx"
x-forwarded-proto: "xxxxxxxxx"
x-forwarded-port: "xxxxxxxxx"
host: "7740d033-115b-4861-8cf8-429452c25ac2.mock.pstmn.io"
x-amzn-trace-id: "Root=1-6734b55f-7662adf2135549a87dfec0a7"
content-length: "2054"
content-type: "application/json; charset=utf-8"
accept: "application/json"
user-agent: "Brevo/1.0 (conversations-services production; +https://brevo.com
REQUEST BODY
{agents: [1], messages: [1], visitor: {…}…}
agents: [1]
messages: [1]
visitor: {…}
conversationId: "rhQiZqBbq874sLriR"
isNoAvailableAgent: false
eventName: "conversationFragment"

Using the server in File mode I can see that #@$ FORM VARIABLES $@# are empty.

So I must assume its the WC Handler that somehow is causing the issue?

Any Ideas ?

Thanks

Rodney

Gravatar is a globally recognized avatar based on your email address. re: Post Data missing on request from WC Handler
  Rick Strahl
  Rodney
  Nov 13, 2024 @ 10:13am

I don't think so. You're either getting the data to the server or you're not. There's no in-between. If Web Connection doesn't show the post data then it's not being sent or filtered out somewhere along the way to the server.

Also watch out for Authentication or OPTION requests - those might preceed the actual POST/PUT request. They fire the same URL but aren't POST/PUT operations and thus have no data.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Post Data missing on request from WC Handler
  Rodney
  Rodney
  Nov 14, 2024 @ 01:09am

Hi Rick

This is what I find so strange ... If I look at a request failed log I can see the data in the buffer, BUT if I look at the request tmp file, its not there.

It is definitely on the POST. (not OPTIONS etc)

 <EventData>
  <Data Name="ContextId">{40030779-0009-7E00-B63F-84710C7967BB}</Data>
  <Data Name="Buffer">{&quot;agents&quot;:[],&quot;messages&quot;: .... removed for brevity by me</Data>
 </EventData>

Gravatar is a globally recognized avatar based on your email address. re: Post Data missing on request from WC Handler
  Rick Strahl
  Rodney
  Nov 14, 2024 @ 09:19am

Not sure I follow. The log shows the POST data? In that case the data is there and it's accessible because it had to read it using the same tools that the Web Connection framework uses.

Not sure why you would be looking at the .tmp file. If you want to debug this set a breakpoint in wwServer::ProcessHit() and look what the incoming data looks like.

+++ Rick ---

© 1996-2024