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

Parents
  • As a workaround can you put the query string in the url yourself, instead of using the params option of makeWebRequest?

    e.g.

    Communications.makeWebRequest(
      "https://www.googleapis.com/calendar/v3/calendars/[email protected]/events?" +
      "timeMin=2020-4-30T12:19:00%2B02:00&" +
      "timeMax=2020-5-1T12:19:00%2B02:00", 
      null // params has to be null for this to work
      ...
     );

    I realize it's not ideal, but this might get you unblocked while you wait for a resolution on the device side.

    Based on this thread, I think this should work (you can a query string in the url or a non-null params arg, but not both at the same time):

    forums.garmin.com/.../makewebrequest-url-with-params

Comment
  • As a workaround can you put the query string in the url yourself, instead of using the params option of makeWebRequest?

    e.g.

    Communications.makeWebRequest(
      "https://www.googleapis.com/calendar/v3/calendars/[email protected]/events?" +
      "timeMin=2020-4-30T12:19:00%2B02:00&" +
      "timeMax=2020-5-1T12:19:00%2B02:00", 
      null // params has to be null for this to work
      ...
     );

    I realize it's not ideal, but this might get you unblocked while you wait for a resolution on the device side.

    Based on this thread, I think this should work (you can a query string in the url or a non-null params arg, but not both at the same time):

    forums.garmin.com/.../makewebrequest-url-with-params

Children
No Data