Files
browser/tests/html/await-fetch.html
2024-12-02 18:00:32 +01:00

11 lines
373 B
HTML

<script>
(async function() {
const response = await fetch(new Request('https://httpbin.io/json'));
if (response.ok) {
document.firstElementChild.appendChild(document.createTextNode(response.ok+"\n"));
const body = await response.text();
document.firstElementChild.appendChild(document.createTextNode("body:"+body+"\n"));
}
}());
</script>