It's been great to rely on a standard function, than any of the libraries to make http requests.
Tho it has been a while since I checked TC39 status on fetch
Thoughts?
WHATWG handles Fetch and their spec[1] was updated seven days ago.
[0] https://github.com/tc39/proposals/blob/master/README.md [1] https://fetch.spec.whatwg.org
Well, duh. It was a lower level API, offering more control.
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.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...