Closed NathanWalker closed 9 years ago
you can replace fetch
with Http
now that the headers work
Yep. I will. Thanks @gdi2290
for example
window.fetch(url, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'bearer ' + this.jwt
}
})
.then(status)
.then(text)
.then((response) => {
this.response = response;
})
.catch((error) => {
this.response = error.message;
});
http.get(url, {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'bearer ' + this.jwt
}
})
.toRx()
.map(status)
.map(text)
.subscribe(
response => {
this.response = response;
},
error => {
this.response = error.message;
}
)
Oh thanks @ctindel, I think we do need to do that right @mgonto?
Yep we do :).
Thanks :).