Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

$http get error with status -1, data: null

$
0
0

@etl wrote:

Hi,
I'm new to Ionic and I'm trying to make a $http get request to a php file on localhost but it returns an error with status -1 and data null. Running the url directly from the browser returns a JSON array with no problem. Angularjs documentation states: "-1 usually means the request was aborted, e.g. using a config.timeout" but I have no idea how to fix this.

I'm making the request as follows:

$http.get('http://localhost:8888/testQuery.php').then(function(response){
//the response from the server is now contained in 'response'
alert('success')
}, function(error){
//there was an error fetching from the server
alert(JSON.stringify(error))
});

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



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