Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70448

Get request not work in android

$
0
0

@sylviolam wrote:

Hi,
my app does not work anymore. in ionic 3 it worked, now with ionic 4 is occurring error in the request.
The get request does not enter the server.
My function on the server:
public function test_app ( username = null, key = null) {
header (“Access-Control-Allow-Origin: *”);
header (“Access-Control-Allow-Headers: *”);
json = '{"a": 1, "b": 2, "c": 3, "d": 4, "e": 5}'; return json;
}

Ionic:

return new Promise ((resolve, reject) => {
let url = this.API_URL + ‘/ test_app’;
this.http.get (url).subscribe ((result: any) => {
resolves (result.json ());
},
(error) => {
reject (error.json ());
});
});

In the browser (ionic serve) is working normally, android does not work

help me please?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>