R
R
RZ2018-03-17 21:48:36
PHP
RZ, 2018-03-17 21:48:36

How to pass a binary string without conversion?

I have a binary string that I received using the `pack` function.
It is necessary to transfer this string via HTTP to another server and process this string as binary there.
I can't think. How to achieve such a result?
Is there anything more elegant than base64?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-03-17
@sergey_zhuravlev_89

base64 is the most elegant way to pass binary data for HTTP.
Well, you can try uuencode, but it's older and less elegant.
The direct binary string will be modified, because the HTTP protocol can't pass unreadable characters - they will disappear. Therefore, encoding is required in a format where all unreadable characters are replaced (the size increases by about 30%).
Or use NOT http.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question