Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to do anything for binary data? #1

Open
norlin opened this issue Aug 9, 2016 · 1 comment
Open

Is it possible to do anything for binary data? #1

norlin opened this issue Aug 9, 2016 · 1 comment

Comments

@norlin
Copy link

norlin commented Aug 9, 2016

Hi,

It seems this will work only for text data.
https://github.com/Lukas-Stuehrk/XMLHTTPRequest/blob/master/XMLHTTPRequest/XMLHTTPRequest.m#L73

Is it possible to do anything for binary data?

@Lukas-Stuehrk
Copy link
Owner

When working with binary data, we need to set the responseType property of the XmlHttpRequest instance either to arraybuffer or blob. Then, when the request is done and the response is availbe, the response property of the instance should either be an array buffer or a blob with the binary data. Unfortunately JavaScriptCore does neither have Uint8Array nor Blob implemented. Because of that we would first need to create implementations for those two interfaces and provide them to the JavaScript context before we could implement binary data. Of course this is possible, but it's a lot of work. And it's more work than I can spend on this library right now, but of course I accept pull requests any time 😉 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants