Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js fetch

fetch('http://example.com')
	.then(response => response.text())
	.then(data => console.log(data))
	.catch(err => console.error(err));
/* for JSON, use response.json() on the 2nd line */
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #fetch
ADD COMMENT
Topic
Name
8+3 =