How to make XMLHttpRequest and receive responseType=arraybuffer ?

64 views
Skip to first unread message

dgront

unread,
Jan 2, 2021, 5:19:12 PM1/2/21
to bry...@googlegroups.com
Hi,

I've tries to fetch binary data with brython using the ajax module. This however requires  to set:
responseType=arraybuffer
property of a XMLHttpRequest object. Can I do that with brython?

At the moment I use "Pythonized Javascript" which looks as below:
request = window.XMLHttpRequest.new()
request.open('GET', './data.bin')
request.responseType = 'arraybuffer'
request.send()

and works just fine. I hope however there is more "Pythonic" solution.

Best,
Dominik
Reply all
Reply to author
Forward
0 new messages