Hello everyone!
I try to make a GET request with HttpClient but i receive nothing
but if i make the same request with HTTP i receive what i need but can’t subscribe and get data.children.
Show your code for more clarity.
Hi @vivek-23
const httpOptions = {
headers: new HttpHeaders({
Accept: "application/json",
"Content-Type": "application/json",
"Content-Encoding": "gzip"
})
};
this.httpCli
.get(
"https://ws.gymsuedoise.fr/api/v2/version&apikey=1234&country=FR",
httpOptions
)
.pipe(map(res => console.log(res)));
}
have you subscribe it in your code or not ?
because without subscribe method i think we can’t get network response.
You will also need to subscribe.
const httpOptions = {
headers: new HttpHeaders({
Accept: "application/json",
"Content-Type": "application/json",
"Content-Encoding": "gzip"
})
};
this.httpCli
.get(
"https://ws.gymsuedoise.fr/api/v2/version&apikey=1234&country=FR",
httpOptions
)
.pipe(map(res => console.log(res)))
.subscribe((data) => {
console.log(data);
});
}