Basically I wrote a simple shell script to capture the input from a WEB POST because POST is converted to standard in via Apache. So a "cat > file" captures all the data. I want to keep the files as raw JSON for parsing later. I prefer them to remain in the JSON format.
Here's my CGI-BIN script:
[webserver:/var/www/html]# cat foo.cgi
#!/bin/sh
TMPFILE=/opt/crashdata/incoming/datafile.
cat > $TMPFILE ; printf "Content-type: text/html\n\n"
Here's my test:
[desktop:~]$ curl -X POST -H 'Content-Type: application/json' --data @sample-json --insecure --silent http://webserver.com/foo.cgi
Here's my results:
[webserver:/var/www/html]# cat /opt/crashdata/incoming/datafile.1417732831810
{ "event": "issue_impact_change", "payload_type": "issue", "payload": { "display_id": 123 , "title": "Issue Title" , "method": "methodName of issue", "impact_level": 2, "crashes_count": 54, "impacted_devices_count": 16, "url": "http://crashdata.com/full/url/to/issue" }}