MakeWebRequest error -200 on device only with iOS phone. (parameters in url issue)

Hi,

Are there a friendly Fenix 6 owner around here, that are willing to help me with a couple of hopefully quick tests???

I have been hacking away on an app that's uses the MakeWebRequest. The starting point was garmins WebRequest sample. Works fine in the sim and on my venu2 and VA3 devices. But when sideloaded onto my friends fenix 6, it throws an error -202.

Originally I just replaced the url in the garmin example, but have now also added 

:method => Communications.HTTP_REQUEST_METHOD_GET
to "option" as the -202 indicated invalid method. And the docs don't say there's a default....
Still works in sim for F6 and on my devices, but not on F6 hardware.
I plan to try to change this to JSON 
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON
and also split the url into 2 and use the parameters. But with several days turn around for a test, it became clear that VS code and a fenix 6 needed to be brought closer together....  
My code looks like this now. For some reason the Insert->code function says I'm block on the forum, so I can't make it look nice here...
Can some please drop this into the garmin sample->WebRequest and run it on Fenix 6 hardware??? And maybe run the clean garmin sample first.
Thanks in advance.
Jesper.
//! Make the web request
public function makeRequest() as Void {
var url = "">api.energidataservice.dk/.../Elspotprices;

var options = {
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON,
:method => Communications.HTTP_REQUEST_METHOD_GET,
:headers => {
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON    //Not yet tested on device with JSON
}
};
Communications.makeWebRequest(
url,
{},
options,
method(:onReceive)
);
}

//! Receive the data from the web request
//! @param responseCode The server response code
//! @param data Content from a successful request
public function onReceive(responseCode as Number, data as Dictionary?) as Void {
if (responseCode == 200) {
var buff = data.get("records");

for(var h = 0; h < buff.size(); h++){
var buff2 = buff[h];
var buff3 = ((buff2.get("SpotPriceDKK") / 10.0).toNumber()).toString();
var buff4 = buff2.get("HourDK");
System.println(h + "=>" + buff3 + " " + buff4 + "##");
}

_notify.invoke(data);
} else {
_notify.invoke("Err: " + responseCode.toString());
}
}


  • Thanks a lot! This was the right hint.
    Finally this did it:
    var params = {"config" => "{\"intensity\":50}"};

    or better:
        var p1 = Lang.format("{\"intensity\":$1$}", [intensity]);
        var params = {};  //empty dictionary
        params.put("config", p1);

    Now it works fine!