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

The server responded with a status of 401 (Unauthorized)

$
0
0

@nbelghiti wrote:

page user.ts

getUsers() {
  this.rest.getUsers()
  .then(data => {
    this.users = data;
    console.log(data)
  }, err =>{
  	this.erreur =  err;
  	   console.log(err);
  });
}

provider rest

getUsers() {
return new Promise((resolve, reject) => {
this.http.get(this.apiUrl+’/accueil’).subscribe(data => {
resolve(data["_body"]);
console.log(data);
}, err => {
reject(err);
console.log(err);
});
});
}

erreur
Failed to load https://www.aef.info/api/Testapi/accueil: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access. The response had HTTP status code 401.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 71119

Latest Images

Trending Articles



Latest Images

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