playground: Send data unmodified via XHR binary mode. #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We don't want the raw bytes to change from client to server, so send using binary mode.
This is done by using
[]byte
parameter, which gets externalized intoUint8Array
akaArrayBufferView
, which is one of the parameters that XHR send accepts for sending binary data.This is based on my newfound understanding of
ArrayBufferView
from discussion at gopherjs/gopherjs@59323cd#commitcomment-9452804. @neelance, I'd like for you to confirm my understanding is correct before merging this.If everything checks out, the XHR package docs should be updated to include that
[]byte
is a valid input type for binary transfer.Finally, the .go file needs to be built and likely the entire playground updated via
update.sh
since there've been changes to GopherJS compiler.Tasks before merging