title: Sending protocol buffers via REST
body: <p>I am trying to implement  protocol buffers for client/server using REST.
  I am still a bit confused if I need to send protocol buffers request in byte format?</p>
  
  <p>I mean, in my client code, do I need to serialize object to byte array?
  For example</p>
  
  <p>protoRequest.build.toByteArray() </p>
  
  <p>And in the server, do I need to c</p>
  
  <pre><code>   @POST
     @Consumes("application/octet-stream")
     public byte[] processProtoRequest(byte[] protoRequest) {
     ProtoRequest.Builder request = ProtoRequest.newBuilder();
     request.mergeFrom(protoRequest)
  }
  </code></pre>
  
  <p>Is this the right thing to do? </p>
  
  <p>Thanks</p>
  
  <p>David</p>