I'm making a JSON array in PHP
$js2 = array("location"=>$js1[0], "status"=>$js1[1],"nc"=>$js1[2],"nt"=>$js1[3],"fc"=>$js1[4],"ft"=>$js1[5]);
the output looks fine in the browser
{"location":"Wellhouse Rock ","status":"falling","hc":"0hr 15min","ht":"18:32 GMT","lc":"3hr 18min","lt":"21:35 GMT"}
but when receiving the returned body via connectIQ (HTTP traffic logs) I get
76\r\n{"location":"Rockall ","status":"rising","hc":"1hr 13min","ht":"19:20 GMT","lc":"7hr 19min","lt":"Sat 19th 01:26 GMT"}\r\n0\r\n\r\n
The widget works in the simulator but not when on a watch. Any ideas how I can strip the 76\r\n etc and Do I need to?
At first I thought this was an HTTPS thing so have sorted that and now make the call via https
I do see Content-Type: application/json; charset=utf-8\r\n in the traffic logs so the header is correct
web call method is using
var options = { :method => Comms.HTTP_REQUEST_METHOD_GET, :headers => {"Content-Type" => Comms.REQUEST_CONTENT_TYPE_JSON}, :responseType => Comms.HTTP_RESPONSE_CONTENT_TYPE_JSON
I could really do with someone helping me get this across the line. Once I have the app working on the watch and sim I am good to start adding features but right now I only get it in the sim
Happy to provide the codeto someone who is willing to help me out. I;ve learned a lot int he past week (its taken me that long to setup an environment and piece bits together).
This is all based off of modifications to the OpenWeatherMapWidget example code
Thanks
Lee