I'm currently developing a bugsense plugin for Corona. The function performing the request is:
local function sendLog(request)
local headers = {}
headers["Content-Type"] = "application/json"
headers["X-BugSense-Api-Key"] = "XXXXXXXXX"
local params = {}
params.headers = headers
params.body =json.encode(request)
network.request( "http://www.bugsense.com/api/errors", "POST", networkListener, params)
end
The request is executed perfectly, but API returns the following error:
{
"data": null,
"error": "list index out of range"
}
The petition sent to BUgsense is:
{
"client": {
"name": "bugsense-ios",
"version": "0.6"
},
"exception": {
"message": "XXXX",
"klass": "",
"where": "",
"backtrace": "XXXXX"
},
"application_environment": {
"appver": "2.0",
"uid": "XXXXX",
"mobile_net_on": "false",
"phone": "iPad",
"appname": "app",
"wifi_on": "false",
"osver": "10.9"
}
}
Obviously, all the XXXXX are replacing sensitive information.
Could anybody help me on what's wrong in the request to originate that error message?
Thanks in advance
Don't know if this will work, but if your stuck it's worth a try: Try indexing headers with numbers instead of strings.