Hi, I wonder if anybody can help me out with a Protobuf parsing issue I'm currently facing. So I've implemented the following protobuf based protocol
message singleConfig {I send this object HttpRequest, on the body of post http request from the c++ based client using the following serialization:
protocol::ProtocolRequest &requestBody;
// fill up the protobuf object
req.body() = requestBody.SerializeAsString();
On my http python server, I expect to get http post requests from body that conform this protocol.
So upon incoming http post request, the body contents arrived and seems valid (I can identify the fields' values from the text)
b'2@\n\x0611.5.1\x12\x061.0(1)\x1a.\n,\n\x08file.json\x12 ecf1c21c77a419f8f7dbfb714a806166'Here's the code that parse the http request. notice that ParseFromString accept 'bytes' formatted input. The parsing finish without any exception so I assume it went alright...
message = HttpRequest()However, an attempt to access each one of the fields in the protobuf structure reveals empty value :
message.osVersion''
...
Any idea what's wrong with the parsing, is it the fact that I'm using python3? bad formatting ? should I pass the body not as a string but from different encoding ?
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/760e7e07-15c5-42db-84ef-a20564f5481bn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/c7c06ec5-c28d-482e-bec2-9e24fed4bea9n%40googlegroups.com.