I've been working on a node.js backend application. Now I want to start programming the frontend but I got struggle executing the HTTP Requests. I have got a physical tablet Samsung Galaxy Tab Active2 for the tests, but the simple GET request doesn't work on this tablet with Android version 9.
I tried to run the exact same app with the HTTP request on Android version 8.1 and it worked. I'm getting a content back.
getTest() {
console.log('test')
httpModule
.request({
url: "http://XXX.XXX.XXX.XXX:8080/XXX/XXX",
method: "GET"
})
.then(
response => {
// Content property of the response is HttpContent
// The toString method allows you to get the response body as string.
const str = response.content.toString();
const head = response.headers.toString();
console.log("Content:" + str + " Header: " + head );
// The toJSON method allows you to parse the received content to JSON object
// var obj = response.content.toJSON();
// The toImage method allows you to get the response body as ImageSource.
// var img = response.content.toImage();
},
e => {}
);
}
Version 8.1 Emulator delivers me the content, but my physical tablet running on Android version 9 only gives the output 'test' to the console. It doesn't event connect to my backend (I configured a logger which gives outputs on requests).