Last Updated: April 13, 2026
·
72.91K
· Lex S

Use fetch instead of XmlHttpRequest in Javascript

Making a fetch call only takes two lines of code:
res = await fetch("https://coderwall.com", { method: "GET" });

await res.text()

Mailer To Go is an email provider on Heroku that is by developers for developers.
We've spend too much time dealing with other mailing services, and decided to create our own.

2 Responses
Add your response

Thanks for sharing, Lex. Agree, fetch simplifies things compared to XMLHttpRequest. Curious if you’ve run into any edge cases where fetch didn’t behave as expected?

9 months ago ·

This is great!

about 1 hour ago ·