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

How do I get my x-auth token from Header?

$
0
0

@RodjFlores wrote:

loginNow(){

    let loginInfo = {
    "email": "mpi5@gmail.com",
    "password": "123456!"
    }
    let headers = new Headers();
    headers.append('Content-Type', 'application/json');


    this.http.post("http://10.227.6.20:5000/api/v1/users/login", JSON.stringify(loginInfo),{headers: headers})
    .subscribe(res => {
        console.log('Login');
        console.log(res)
        console.log(res.url)
        console.log(res.headers.get('Date'));
        console.log(res.json());
        console.log(res.headers.get('23423434'));

    }, (err)=>{
        console.log('POST failed')
        console.log(err)
    }
    );
}

My console.log(res) does not include it for some reason, but I can see the token in Chromes's inspect network under Response Headers.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



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