Issue
I am trying to do simple Get request to https server using proxy.conf.json
"/test": {
"target": "https://192.168.1.10",
"changeOrigin": true,
"secure": false,
"logLevel": "debug"
}
It works in browser, but on device I get some kind of html code
this.http.get('/test', {responseType: 'text'}).subscribe(res => {
console.log('res_',res);
this.res1 = res;
});
Solution
In capacitor.config.json add
"server": {
"cleartext": true
},
so it look like:
{
"appId": "com.app.ionic",
"appName": "app",
"bundledWebRuntime": false,
"npmClient": "npm",
"server": {
"cleartext": true
},
"webDir": "www",
"plugins": {
"SplashScreen": {
...
}
},
"cordova": {}
}
Answered By - Dayvid Kelly
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.