HTTP: Difference between revisions

Content added Content deleted
imported>Gabrielsroka
imported>Gabrielsroka
Line 1,413: Line 1,413:
Using fetch API and async/await:
Using fetch API and async/await:
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
const resposne = await fetch('http://rosettacode.org');
const response = await fetch('http://rosettacode.org');
const text = await response.text();
const text = await response.text();
console.log(text);
console.log(text);