I'm attempting to make a makeWebRequest() from the background (of a DataField) but get absolutely no response (no error response) , not even a call to the designated 'callBackMethod'. I am able to use other methods in the communications class. For example, I'm able to use 'openWebPage()' no problem. I was curious if anyone has run into this problem or had any insight of changes that might occur when running things like this from the background.
Thanks
Here is the code:
using Toybox.Background;
using Toybox.Communications as Com;
function onReceive(responseCode, data) {
if (responseCode == 200) {
System.println("Request Successful | Data -> " + data);
} else {
System.println(responseCode);
}
}
function makeRequest() {
var url = "">www.mocky.io/.../5185415ba171ea3a00704eed";
var options = {
:method => Comm.HTTP_REQUEST_METHOD_GET,
:responseType => Comm.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
Comm.makeWebRequest(url, {}, options, method(:onReceive));
}