-
Notifications
You must be signed in to change notification settings - Fork 4
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
Provide support for Binary Data #12
Comments
This would be pretty cool. But right now, one of the nice things about Would it be possible to extract out the minimal HTTP client functionality as one lib and then build on that in another lib? |
Ah sorry, I didn't have intentions on adding |
I see. Would |
Yep exactly. |
* Request implementations now supply a `Uint8Array` of binary data through to the `chunkParser`. * `defaultChunkParser` converts the `chunkBytes` into a string for processing * Overhauled how parserState is handled; no longer assume that the `chunkParser` will emit a string; instead we use a `state` object whose contract is wholly owned by the parser (we just shuffle it around internally). * Added test-coverage for UTF-8 characters * Added dependency on `utf-8` lib for handling (un)marhsalling of binary data to text. * Updated documentation * Updated npm dependencies. Inspiration provided by @mwitkow and @ariutta -- many thanks! :)
* Add support for binary data (#12) * Request implementations now supply a `Uint8Array` of binary data through to the `chunkParser`. * `defaultChunkParser` converts the `chunkBytes` into a string for processing * Overhauled how parserState is handled; no longer assume that the `chunkParser` will emit a string; instead we use a `state` object whose contract is wholly owned by the parser (we just shuffle it around internally). * Added test-coverage for UTF-8 characters * Added dependency on `utf-8` lib for handling (un)marhsalling of binary data to text. * Updated documentation * Updated npm dependencies. Inspiration provided by @mwitkow and @ariutta -- many thanks! :) * Use TextEncoder / Decoder over `utf-8`. * Update README to convey which polyfills are required for crappy browsers. * Remove typearray polyfill Would appear that IE10 has typedarray support :) * Add test to ensure we always get a Uint8Array supplied. * Instantiate TextEncoder/Decoder only once. Use stream option. * Patch up flakey test. Browsers using the fallback `xhr` transport should expect an addtional call to their `chunkParser` as we flush out the state of the `TextEncoder` when the XHR connection is closed. * Remove left over utility methods.
Landed on v0.5 |
It would great to use this as a transport for Protobuf.js; this could then be combined with mwitkow/grpc-browser-compat to provide a grpc-client for browsers...
The text was updated successfully, but these errors were encountered: