I’m trying to use a webhook to post data to a web service. I’ve followed the documentation and the webhook fires but it always sends as application/x-www-form-urlencoded and it ignores my json template. I also included the ‘noDefaults’ flag but it ignores that too. My Webhook is defined as follows:
If I then use the CLI as follows: particle publish myEventName2 "{ \"s\":500, \"d\":\"Test\", \"v\":2 }"
The webhook fires but it sends the following in the body of the request: event=myEventName2&data=%7B%20%22s%22%3A500%2C%20%22d%22%3A%22Test%22%2C%20%22v%22%3A2%20%7D&published_at=2015-12-18T15%3A07%3A44.367Z&coreid=001_55d88081e51d46a539374a9b_1450451264366_2247919
I want the webhook to post my json to the web service, replacing the values from my ‘data’ string. I’m certain I’m overlooking something obvious - can anyone see what it is?
I am hitting the exact same issue, and I’ve been banging my head for hours now. I made a small update to the JSON body of my existing webhooks, which have been working fine for months now, and I’m getting the exactly same broken content type. I’ve tried adding a custom Content-Type: application/json header to force it, but that is ignored as well.
The same webhooks in my production environment that I haven’t updated continue to work fine.
Has anyone from Particle looked into this, or has anyone found a solution? Looks like at this point I have to refactor my API to consume form encoded events or scrap webhooks altogether.