T
T
Triborg-3332020-09-25 20:36:16
Node.js
Triborg-333, 2020-09-25 20:36:16

How to send an array via binary protocols?

How to send an array via binary protocols?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2020-09-25
@bingo347

https://msgpack.org/
https://developers.google.com/protocol-buffers?hl=ru
https://google.github.io/flatbuffers/
choose

N
Nadim Zakirov, 2020-09-25
@zkrvndm

Convert your array to JSON, generate a text Blob into which you write the resulting JSON, then pack the Blob into a zip archive and calmly send the archive to the server via Ajax. The method is universal and can be used even in a browser, it can save in some unique cases when you need to send large amounts of data with minimal network load. There is a wonderful JSZip library for working with JavaScript archives.
If you are interested in just sending an array directly, without compression and purely for show, so that the data has a binary type, then take a look here:
https://learn.javascript.ru/xhr-forms#post-s-multi...
There are examples of POST requests in binary form.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question