Question

Webhook "411 ERROR Content Length Not Set."

  • 14 February 2018
  • 2 replies
  • 137 views

We are currently building webhooks to pass data back to our systems for better conversion tracking.


If we download the report in JSON format, and then send that json via CURL to the webhook it works correctly.


However if we send the data directly from looker, it fails and we get a “411 ERROR Content Length Not Set.”


Is there a way to pass the header content length on looker side?


The current header data we are using is:


header(“Access-Control-Allow-Origin: *”); //This allows us to receive data from any domain (including looker)

header(‘Access-Control-Allow-Headers: Content-Type, Content-Range, Content-Disposition, Content-Description’);

header(‘Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS’);

header(‘Content-Type: application/json’);

header(‘Content-Length: 0’);


If there isn’t a way to pass the header info via the call:


Would anyone have any documentation or code examples on how to receive the webhook via PHP without headers?


Thanks,


2 replies

Userlevel 2

Hey @Marceau_Boulenger,


There aren’t any examples in PHP for receiving the webhook without headers. However, the workaround for this issue is to use another service (such as Zapier) as a middleman to listen to the webhook and forward it on to your system so the header content length will be included. I will be letting the engineering team know you ran into this issue. Hope this helps!


Best,

Ryan

Thanks a lot.

We have tested it with Zapier and it is working now.

Thanks for your suggestion

Reply