Closed MSusik closed 8 years ago
I was trying to find a bug on the server for hours, but it turns out it was much simpler... Try these: 1) Make values a dictionary rather than a string(remove """) - values = {...} 2) General code template:
from urllib2 import Request, urlopen
values = {...}
request = Request('http://54.93.105.103:8000/vd1/crash-reports/')
request.add_header('Content-Type', 'application/json')
response = urlopen(request, json.dumps(values))
print response
3) Make sure you are up to date with what kind of data the server expects of you. I've noticed that the database has changed in the last few hours and so has API.
Here is an example of how you can submit a crash report to the server at present:
from urllib2 import Request, urlopen
import json
values = {"crash_report":{"system_info": {"version": "14.04.1 LTS", "packages":"[]", "architecture":"x86"},"exit_code": 1,"stderr_output": "Lines from stdErr."}}
request = Request('http://54.93.105.103:8000/vd1/crash-reports/')
request.add_header('Content-Type', 'application/json')
response = urlopen(request, json.dumps(values))
print response
We already switched to application/json
results in
See http://docs.dpcs.apiary.io/#reference/crashes/crash-report-collection/send-a-new-report
The bug can be also reproduced when you use our client.