Hi, I'm playing around with makeWebRequest and cannot undrstan why I don't get this simple test code to work. The System gives back -400 (invalid response body data), regardless of what I put in as response type.
Here is the code:
(:background)
class WebGetWFBackground extends Toybox.System.ServiceDelegate {
function onTemporalEvent() {
webRequest();
}
function onWebRequestComplete(responseCode, responseData) {
Background.exit(responseCode);
}
function webRequest() {
var url = "https://www.garmin.com/sv-SE/";
var options = {
:method => Comms.HTTP_REQUEST_METHOD_GET,
:headers => {},
:responseType => Comms.HTTP_RESPONSE_CONTENT_TYPE_TEXT_PLAIN
};
var responseCallback = method(:onWebRequestComplete);
Comms.makeWebRequest(url, {}, options, responseCallback);
}
According to the HTTP log in the simulator, the response I get is Text/HTML. It looks like it's a chunked reponse. (reponse start with "1cfea\r\n"). Can CIQ not process chunked responses?
here's a screnshot on the HTTP traffic log:
