29 ms·
> Fetch isn't much better. Half-arsed at best, and also needs a higher level wrapper to achieve the same terseness as popular AJAX utility libs. Really? le
by untog 9y ago
> Fetch isn't much better. Half-arsed at best, and also needs a higher level wrapper to achieve the same terseness as popular AJAX utility libs.
Really?
let response = await fetch('http://www.example.com');
let json = await response.json();
It's not not terse.
- coldtea 9y agoThat's just for a GET. Sending e.g. a JSON POST request requires you to specify the content type and to manually stingify the payload. It's better than XMLHttpRequest but not as terse as the tons of helper libraries that we used (instead of XMLHttpRequest) anyway...