var req = new XMLHttpRequest();
req.addEventListener('load', function (txt) {
console.log(txt)
}, false);
req.open("get", "/foo.txt", true);
req.send();
I feel pretty stupid right now like I'm missing something obvious, but that above is returning 200 and the response has the contents of the file. The server logs show a successful request as well. However, txt
is showing an XHR object with no responseText and 0 response length. The file is just a text file. I also tried changing it to .json just to see if it'd do something different.