---
title: "Comment by Dwayne Charrington on \"5 best libraries for making AJAX calls in React\" | Hashnode"
description: "How about no library at all and just use a native XMLHttpRequest instead? Fetch is alright, but it has quite a few shortcomings now and you need a polyfill to e"
url: "https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66/comment/57be3ab91351c2290bba1fd9"
---

[Discussion](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66)

Comment [5 best libraries for making AJAX calls in React](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66)

[Dwayne Charrington](https://hashnode.com/@vheissu)

[Aug 25, 2016](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66/comment/57be3ab91351c2290bba1fd9)

How about no library at all and just use a native XMLHttpRequest instead? Fetch is alright, but it has quite a few shortcomings now and you need a polyfill to even use it across browsers. The specification is in flux and until they address the issues like cancellation and monitoring file upload progress.

```
var request = new XMLHttpRequest();
request.open('GET', '/api/content', true);

request.onload = function() {
    if (this.status >= 200 && this.status < 400) {
        var data = JSON.parse(this.response);
    } else {
        console.error('Response received and there was an error');
    }
};

request.onerror = function() {
    console.error('Request error');
};

request.send();
```

[Rommy](https://hashnode.com/@rommyarb)

[Mar 16, 2019](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66/comment/57be3ab91351c2290bba1fd9#reply-5c8d30639ee0c53340ffdd39)

Nope

[Dwayne Charrington](https://hashnode.com/@DigitalSea)

[Mar 18, 2019](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66/comment/57be3ab91351c2290bba1fd9#reply-5c8f657953cb776827a53b68)

Rommy, you do realise you're responding to a three year old comment, right? Many of these issues have been resolved now.
