You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not currently (as of Brython 3.8.9) possible to request a Blob response format when using aio.ajax method. This is a problem when we want to fetch a file, and binary is not a good alternative, specially if we want to upload the fetched field using an other ajax request (which is my use case).
I would like to be able to do something like that, and that doesn't seem possible with current aio module:
r=awaitaio.get(some_url, format="blob")
blob=r.data# some processing…awaitaio.ajax("PUT", some_other_url, data=blob)
aio module is nice to avoid callbacks hell that we would have with blocking browser.ajax
Thanks!
note: maybe I've missed something with the binary format, but it seems that we can't use it to send binary data, as aio.ajax expects a str or a dict according to doc.
The text was updated successfully, but these errors were encountered:
@PierreQuentel Hello, thanks for that. I guess that works too, but what if we get a blob, is there a way to convert a JS blob to Brython bytes? Does using bytes has an impact on performances (memory or CPU)? Thanks!
Hello,
It is not currently (as of Brython 3.8.9) possible to request a Blob response format when using
aio.ajax
method. This is a problem when we want to fetch a file, andbinary
is not a good alternative, specially if we want to upload the fetched field using an other ajax request (which is my use case).I would like to be able to do something like that, and that doesn't seem possible with current
aio
module:aio
module is nice to avoid callbacks hell that we would have with blockingbrowser.ajax
Thanks!
note: maybe I've missed something with the
binary
format, but it seems that we can't use it to send binary data, asaio.ajax
expects astr
or adict
according to doc.The text was updated successfully, but these errors were encountered: