I am using protobuf and need to send converted bytes with api request, and need to decode again on server, string will be like this:
\b\xC0\xB3\xB9\xDD\xFC\x1C\x12XBalance debited with 62.0 Expiry Date is 09-11-2016 09:10:00 Remaining Balance is 1490.0\x1A\x0FDebited Balance\"XBalance debited with 62.0 Expiry Date is 09-11-2016 09:10:00 Remaining Balance is 1490.0(\x99\x9C\xCE\xBF\x05
How can I send this type of the request and get properly on server?
Or anyone help me to send information using protobuf.
When I send string in body in then it replace form
\x99\x9C\xCE\xBF\x05
to
x99x9CxCExBFx05
and when send in headers it replaced like
\\x99\\x9C\\xCE\\xBF\\x05
Thanks
Besides what I have written in comments, the ruby
protobuf
binding home contains a perfect example of how it’s to be achieved:Everything you need is to encode the bytes before sending:
and now send
encoded_data
to your recipient.