I'm attempting to develop a Nest thermostat app using ConnectIQ but am hindered by the fact that the Nest API requires that a client handle 307 redirects. Web requests are sent from a Connect IQ device (In my case a fenix 3 watch) to google via the Garmin Connect App (In my case a Sumsung s6). I would expect the Connect App to automatically handle 307 redirects but unfortunately this is not the case. More critically, instead of returning a 307 response to the watch/device it returns a 401 with no response body... This makes it impossible to manually handle the redirect.
I'm using makeWebRequest:
Comms.makeWebRequest("developer-api.nest.com", {}, {
:method => Comms.HTTP_REQUEST_METHOD_GET,
:headers => {
"Content-Type" => Comms.REQUEST_CONTENT_TYPE_JSON,
"Authorization" => "Bearer " + token
},
:responseType => Comms.HTTP_RESPONSE_CONTENT_TYPE_JSON
}, method(:handleResponse));
Anyone have any success accessing an API that uses 307 redirects? Seems like a bug or at least a missing feature
Thanks