Загрузка...

JavaScript How to get JSON data from the API of a web-service?

Let’s use a free API that returns some data.
To get data we need the fetch method.
This method has one parameter: URL.
The method returns a promise object.
The promise has the then method to handle the response asynchronously.
We need the json method to convert the response to the JSON data.
OK.
Let’s check it out.
We have got the response from API.
The response is in JSON format.

Видео JavaScript How to get JSON data from the API of a web-service? канала Samovar tutorials
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять