Some notes regarding Wards quick webhook implementation:
> Note: We decided it was not worth digging around the ruby implementation to figure out how to to the jsonrpc POST from ruby correctly. > I've suggested a fix based on a missing space
I understand from an email that Ward's POST is failing. We investigate why. Here is the request as i gather from Ward's email (though the email has the code wrapped in Ruby):
curl -XPOST -H 'Auth:3546736' -H 'Content-type:text/json' https://rest.livecode.world/scrape -d '#{counts.to_json}’
> Note: there seems to be a couple of errors in the code. Quotation and a lack of a space in the `-XPOST` param.
The basic curl POST request succeeds today as it did yesterday. The same using POST from Livecode, so we try posting json with curl. Here are a couple of examples.
curl -H "Content-Type: application/json" -X POST -d '{"username":"mkyong","password":"abc"}' https://rest.livecode.world/scrape
curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST https://rest.livecode.world/scrape
You can also view the result in the browser (ie as an HTTP GET response or as a POST request using curl:
curl -d "username=mkyong&password=abc" https://rest.livecode.world/scrape
Or in the browser: - http://rest.livecode.world/scrape
As we expect these examples work well - so most likely an issue with Ward's Ruby code? Perhaps the lack of a space in `-XPOST` param? The Content-type header is wrong but it should make no difference to the Transporter as i am not checking (yet) for that.
I've done a first set of checks on the webhook endpoint at `https://rest.livecode.world/scrape`. I've also just added custom logging which you can view in this wiki page which is constructed every time someone hits the end point - no checking, both GET and POST work.
It seems to me that we are successfully receiving `POST` requests and logging the time, but are failing to read the input variables: - Report Lineup
The next steps involve: 1. Reading Webhook Parameters from Ward 1. Asynchronous Webhook Actions