Добрый день, уважаемые!
Я недавно начал изучать JS и решил понять основы React создавая мини-приложения.
Столкнулся с проблемой получения данных по API
Как отсюда получить данные - понимаю
{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":300,"main":"Drizzle","description":"light intensity drizzle","icon":"09d"}],"base":"stations","main":{"temp":280.32,"pressure":1012,"humidity":81,"temp_min":279.15,"temp_max":281.15},"visibility":10000,"wind":{"speed":4.1,"deg":80},"clouds":{"all":90},"dt":1485789600,"sys":{"type":1,"id":5091,"message":0.0103,"country":"GB","sunrise":1485762037,"sunset":1485794875},"id":2643743,"name":"London","cod":200}
this.setState({
temp: data.main.temp,
city: data.name,
country: data.sys.country,
pressure: data.main.pressure,
});
А вот с PrivatBank API такое не выходит.
[{"ccy":"USD","base_ccy":"UAH","buy":"26.70000","sale":"27.00000"},{"ccy":"EUR","base_ccy":"UAH","buy":"29.85000","sale":"30.45000"},{"ccy":"RUR","base_ccy":"UAH","buy":"0.38000","sale":"0.41500"},{"ccy":"BTC","base_ccy":"USD","buy":"4889.6341","sale":"5404.3325"}]
Посоветуйте пожалуйста литературу