Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure how to use field with type "bytes" #104

Open
rahelbeloch opened this issue Jun 28, 2023 · 1 comment
Open

Not sure how to use field with type "bytes" #104

rahelbeloch opened this issue Jun 28, 2023 · 1 comment

Comments

@rahelbeloch
Copy link

rahelbeloch commented Jun 28, 2023

I am sending requests using a protobuf message which has a field with type bytes - specifically image bytes. I convert the image to bytes using a Python script and get the following output:

\xff\xd8\xff\xe0\x00\x10JFIF[...]

This, I then input to the bytes field in Protoman:

Screenshot 2023-06-28 at 13 12 36

I would expect that exactly the same \xff\xd8\xff\xe0\x00\x10JFIF is transferred to the server, but what I get at the server side is:

\xc5\xf7\xf1w\xcc_\x7f\x17\xb4\xc7M1\xd7BE

I assume this has to do with the representation the data is in, I am inputting a byte string. What does the byte type actually expect?

@jaosn60810
Copy link

I encountered a similar issue when sending image bytes using protobuf. I resolved it by converting the image into a base64 string before sending it. This approach worked for me, and it might solve your problem as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants