V
V
vdsp2017-06-07 11:31:21
css
vdsp, 2017-06-07 11:31:21

Binary data transfer format?

It is required to give various files in the API, be it pictures, documents, etc., what transfer format is suitable for this?
Previously, json was used, but it is inconvenient to convert everything to base64, I didn’t use binary formats: bson, Protocol_Buffers, etc., I don’t understand which one to choose and whether it is suitable for the task. Recommend format

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Vasiliev, 2018-10-06
@corvus007

In the console it says that there is a protocol
https://jsfiddle.net/mrnobody/mrv0kth6/9/

R
Roman Mirilaczvili, 2017-07-01
@2ord

You can specify the type in the response body

{
 "url": "https://cdn.mysite.com/mybucket1/somefile.mp4?expires_at=3987655&md5sum=a1b2c3ff"
}

The client, having received the link, will download the file itself from the CDN cache server, as is. After all, the HTTP protocol allows you to separately transfer binary data without any transformations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question