Really appreciate the help here - we are trying to read the JSOn response from this particular webservice which used to work earlier - but stopped working a couple of weeks ago. After a few hair wrinching hours - I am posting here for help.
Note: we are getting the same response in both build 894 (old public) as well as 971/972. I would want to try this with the latest daily build - but has network.request changed? The strange bit is that other pages are returning fine with this call.
any help appreciate. tks
[lua]
local function networkListener( event )
if ( event.isError ) then
myText.text = “Network error!”
else
myText.text = “See Corona Terminal for response”
print ( "RESPONSE "… event.response )
end
end
headers = {}
headers[“Content-Type”] = “application/json”
local params = {}
params.headers = headers
– without params
network.request( “http://api.theflightwas.com/v1/getOffers.json”, “GET”, networkListener)
– with params
–network.request( “http://api.theflightwas.com/v1/getOffers.json”, “GET”, networkListener, params)
[/lua]