protobuf has nothing to do with http. It is just a message modelling system where the library will build and validate messages. And provide access to the data.
So, in your case, without actually rely understanding what you are doing, thre could be different approach 1 - You could define/model a message type that includes all the http header you fell are mandatory. And then include that message into some request message this passed to your RPC code. he header sub-message is then analysed by your code. 2 - Or you could lists all the headers, by name, into a repeat filed of the request message. Again, your RPC code would verify that the headers are present in the HTTP object is processes. I am sure many other way of handling this are possible. On Thursday, January 19, 2023 at 8:27:45 p.m. UTC-5 [email protected] wrote: > Hi all! > > I'm learning how to use proto buffers to define an RPC how can I specify > in my.proto file a HTTP header is required e.g. > > // This needs the Auth header to be present to do something sensible > https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization > rpc DoThing(DoThingReq) returns (DoThingRes) { > } > > Thanks! > David > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/a52fbabc-2702-488c-a38b-bcb03161b99dn%40googlegroups.com.
