Hello guys I am new to Ionic C: and I have a first problem and I can not solve: C i call the deezer API and receive the expected response
getProfiles(){
this.http.get(‘https://api.myjson.com/bins/mcjrb’)
.map( res => res.json())
.subscribe(data => {
console.log(data);
});
No problem
But when I change the url I no longer receive the response of the api
getProfiles(){
this.http.get('api.openweathermap.org/data/2.5/forecast?id=524901&APPID=7981ddbe4d2dfb962eec709fd94b654c ')
.map( res => res.json())
.subscribe(data => {
console.log(data);
}
the error:
http://localhost:8100/api.openweathermap.org/data/2.5/weather?q=London&appid=7981ddbe4d2dfb962eec709fd94b654c 404 (Not Found)
u @ polyfills.js:3
t.scheduleTask @ polyfills.js:3
onScheduleTask @ polyfills.js:3
t.scheduleTask @ polyfills.js:3
r.scheduleTask @ polyfills.js:3
r.scheduleMacroTask @ polyfills.js:3
(anonymous) @ polyfills.js:3
r.(anonymous function) @ polyfills.js:2
(anonymous) @ http.es5.js:1278
Observable._trySubscribe @ Observable.js:57
Observable.subscribe @ Observable.js:45
MapOperator.call @ map.js:54
Observable.subscribe @ Observable.js:42
MeteoServiceProvider.getProfiles @ meteo-service.ts:16
PlayacorazonesPage.ionViewDidLoad @ playacorazones.ts:39
ViewController._lifecycle @ view-controller.js:564
ViewController._didLoad @ view-controller.js:437
NavControllerBase._didLoad @ nav-controller-base.js:942
t.invoke @ polyfills.js:3
onInvoke @ core.es5.js:4149
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
NgZone.run @ core.es5.js:4017
NavControllerBase._viewAttachToDOM @ nav-controller-base.js:590
NavControllerBase._transition @ nav-controller-base.js:679
(anonymous) @ nav-controller-base.js:361
t.invoke @ polyfills.js:3
onInvoke @ core.es5.js:4149
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
(anonymous) @ polyfills.js:3
t.invokeTask @ polyfills.js:3
onInvokeTask @ core.es5.js:4140
t.invokeTask @ polyfills.js:3
r.runTask @ polyfills.js:3
o @ polyfills.js:3
invoke @ polyfills.js:3
core.es5.js:1084
ERROR Response {_body: "<!DOCTYPE html>↵<html lang="en">↵<head>↵<meta char…ermap.org/data/2.5/weather</pre>↵</body>↵</html>↵", status: 404, ok: false, statusText: "Not Found", headers: Headers…}
When testing the second url in the browser gives me the corresponding json