Acknowledged

makeWebRequest: bad request on some devices

https://forums.garmin.com/developer/connect-iq/i/bug-reports/makewebrequest-bad-request-on-some-devices?CommentId=0afa464f-13fb-47f6-83cc-77c5bdc16f11

In makeWebRequest, I am getting a 400 if I am in a +GMT timezone and it works successfully in a -GMT timezone using the GoogleAPIs for calendar events. According to https://stackoverflow.com/questions/30294500/google-calendar-api-doesnt-accept-datetime-with-positive-utc-offset/58860565#58860565, "+" needs to be encoded as "%2B"

Thanks

  • A bit more investigation: 

    even if I put all params into the query and urlencode (including the +)  them I'm still getting the bad request error 400. 

    Probably caused by a param: &fields=items(summary,location,start/dateTime,end/dateTime) regardless if I urlencode the fields' value. 

    To sum it app: 

    • initial solution: passing params to makeWebRequest as params works on most of phones but it fails on some of the phones.
    • passing just essential params in query with urlencoded timezone works, but fails on OutOfMemory when there are more calendar events
    • passing all params in the query (including fields to limit data load not ot get OutOfMemory) gets error 400 again regardless if I urlencode values or not. 

    Trap next to trap… 

  • Indeed. Forcing the GMT- instead GMT+ and removing the params passed.

    Initially I missed that the params must be removed, but this way it worked.

    I'm not sure how related it is to the Google API, because it works completely fine with GMT+ on my Android while the same app in the same watch fails with GMT+ on my iPhone.

    Now how make it work on the GMT+? Or will Garmin guys finally fix it after years?

  • did you happen to try FlowState's solution? I was able to confirm that the infinite login issue was resolved when using a GMT- zone.

  • Hi. I’m not using the “Simply Late” source but just noticed it was experiencing the same issue I was when I was researching.

    See FlowState’s solution below for encoding the query string into the URL (get parameters instead of post). That worked for me. 

  • I verified I'm experiencing this infinite login issue due to being in a GMT+ zone, by manually setting the watch time to GMT- as you stated.

    Were you able to get the "Simply Late" watch face to work in GMT+ by encoding the "+" sign?