Closed benjajim closed 4 years ago
I just ran into this and couldn't find a way of sending over 'data' with the currently available version of PreloadJS that ships with Animate 2020, unless I am missing something it seems to be completely ignored and only works with values (I did see that maybe data is supposed to be used in conjunction with auth but I need a way to send over raw data with the load).
Around line 209 of preloadjs_net_XHRRequest.js you can modify the try-catch to make use of data in this way:
try {
if(this._item.values) {
this._request.send(createjs.URLUtils.formatQueryString(this._item.values))
}
else if(this._item.data) {
this._request.send(this._item.data)
}
else {
this._request.send()
}
}
catch(a) {
this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))
}
This at least works for me in my specific use-case, I'm just adding it here since this came up when I was searching for this perceived 'issue', I'm in no way suggesting this is an appropriate 'fix' :D
Edit: This doesn't do anything with 'data', it assumes the data is stringified/serialized already by you.
Thanks! I must've coded around it at the time. I appreciate the post! All the best
There seems to be a bug when running the following code:
If I'm right, it doesn't appear to handle the "data" property anywhere. If you send using "values" you get some success, but there's definitely something wrong, or I'm reading it wrong.
The code where I believe it should be handled is in
XHRRequest._createXHR() and XHRRequest.load()
If I'm missing something, please let me know.
Thanks!