Answers for "vanilla js send get request"

0

vanilla js send get request

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);
});
Posted by: Guest on September-01-2021
0

vanilla js send get request

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);
});
Posted by: Guest on September-01-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language