“Vanilla JS Отправить запрос получить запрос” Ответ

Vanilla JS Отправить запрос получить запрос

fetch('https://jsonplaceholder.typicode.com/posts').then(function (response) {
	// The API call was successful!
	return response.json();
}).then(function (data) {
	// This is the JSON from our response
	console.log(data);
}).catch(function (err) {
	// There was an error
	console.warn('Something went wrong.', err);
});
Gleaming Gazelle

Vanilla JS Отправить запрос получить запрос

fetch('https://jsonplaceholder.typicode.com/posts').then(function (response) {
	// The API call was successful!
	console.log('success!', response);
}).catch(function (err) {
	// There was an error
	console.warn('Something went wrong.', err);
});
Gleaming Gazelle

Ответы похожие на “Vanilla JS Отправить запрос получить запрос”

Вопросы похожие на “Vanilla JS Отправить запрос получить запрос”

Больше похожих ответов на “Vanilla JS Отправить запрос получить запрос” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования