Closed fsw closed 1 year ago
Because this event was missing, using HttpRequest with onLoad listener was not working as listener was never called:
var xhr = HttpRequest(); xhr.open('GET', 'https://swift.shop', async: true); xhr.onLoad.listen((e) { print('LOADED'); }); xhr.send();
This event was also used internally in request method so methods like getString were not working as well:
request
getString
HttpRequest.getString('https://github.com').then((content) { print(content); });
I think that this is a correct moment to send this event according to specs. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/load_event
I have added a test for getString method that fails without this fix.
Thank you for the pull request again! 👍
Because this event was missing, using HttpRequest with onLoad listener was not working as listener was never called:
This event was also used internally in
request
method so methods likegetString
were not working as well:I think that this is a correct moment to send this event according to specs. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/load_event
I have added a test for getString method that fails without this fix.