Hi, I am trying to send data via POST to a php website I made using the Advanced Webhook builder.
I can send the data to Thingspeak from the Webhook Builder without any trouble using the destination URL: http://api.thingspeak.com/update?key=YOURTHINGSPEAKAPIKEY
and POST payload: <<decdata>>
where <<decdata>> is &lat=31.1&lon=-106.1 (or something close)
I can also send data to my php page using curl from my desktop: curl --data "&lat=31.1&lon=-106.1" http://MYSITE.com/track.php
But when I try send the data directly to my site using the Webhook Builder, using the destination URL: http://MYSITE.com/track.php
and POST payload: <<decdata>>
I get a ‘route error’ message in the dashboard. Unfortunetely, it is truncated:
Server sent HTTP status code 500 with body: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<tit
Is there a way to get the full error message? Also, is there something obviously wrong with my approach?
It is my own sketch, but I am developing this remotely and the remote computer is shut down right now. I am using the simulate feature right now to resend data that came in earlier. The data did show up correctly in the dashboard, however:
Oh I may be misunderstanding. I wonder if that missing header is the issue. You can add that in the advanced webhook builder manually so it matches up.
Well, yes, but I do get the error message that is truncated. If I malform the request completely, the error message changes to a 404…
Using the requestbin that was suggested, it seems likely that the missing form parameters are the culprit.
One more datapoint:
It looks like the POST data is truly empty. I went and submitted to http://posttestserver.com/post.php
Using the dashboard, which gives me:
I dug into this some more and it looks like it is because of the Content-Type header.
When I set the Content-Type correctly based on the payload then everything works:
It doesn’t really. We send it exactly as shown. I think that guy is just pulling all the variables right out of what PHP gives you and it normalizes things into that format. RequestBin is a more accurate representation of what gets sent.
Content-Type is the official HTTP header.