I'm testing on Android so I don't know about iOS.
Test code:
import * as HTTP from '@nativescript-community/https';
...
let url = "https://historylines.com/nexus/ttw.jsp?a=add&app=LA&uid=test_fde9f33899e13fcc&drill=Open%20Shooting%20-%20Single%20Target&shots=7";
console.log("logSession: "+url);
HTTP.request({
url: url,
method: "GET",
timeout: 30000
})
.then((response) => {
let content = response.content.toJSON();
console.log("logSession response: "+JSON.stringify(content, null, 4));
if(!content){
console.error("logSession response is missing content");
reject("logSession response is missing content");
}else{
resolve(content);
}
})
.catch((err) => {
console.error("logSession failed, "+err);
reject(err);
});
When I run this code or similar with core/http, it succeeds. When I put the URL in a web browser, it succeeds. When I run with https, it fails with:
logSession failed, Error: android.os.NetworkOnMainThreadException
I'm testing on Android so I don't know about iOS.
Test code:
When I run this code or similar with
core/http, it succeeds. When I put the URL in a web browser, it succeeds. When I run withhttps, it fails with: