I have a problem with connecting Web API with widget. Problem arises from changing the HTTP protocol to HTTPS. It works fine in HTTP.
source code:
var url = "kciszewski.e-kei.pl/sampleJson.php";
var options = {
:method => Communications.HTTP_REQUEST_METHOD_GET,
:headers => {
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_URL_ENCODED,
},
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
var responseCallback = method(:onReceive);
downloadingData = true;
Communications.makeWebRequest(url, null, options, method(:onReceive));
function onReceive(responseCode, data) {
responseCodeGlobal = responseCode;
dataGlobal = data;
System.println("data = "+data);
if (responseCode == 200){
System.println("Request Successful");
}
else {
System.println("Response: " + responseCode);
}
}
Code output:
data = null
Response: 404
Where in other place works perfectly.
Thanks for the help in advance,
Kamil