math-io | Math library
kandi X-RAY | math-io Summary
kandi X-RAY | math-io Summary
math-io
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of math-io
math-io Key Features
math-io Examples and Code Snippets
Community Discussions
Trending Discussions on math-io
QUESTION
I am building a client/server system in go, using gRPC and protobuf (and with a gRPC gateway to REST).
I use metadata in the context on the server side to carry authentication data from the client, and that works perfectly well.
Now, I'd like the server to set some metadata keys/values so that the client can get them, alongside with the response. How can I do that? Using SetHeader and SendHeader? Ideally, I'd like every single response from the server to integrate that metadata (can be seen as some kind of UnaryInterceptor, but on the response rather than the request?)
...ANSWER
Answered 2017-Dec-04 at 18:20I finally found my way: https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md
So basically, grpc.SetHeader()
+ grpc.SendHeader()
and grpc.SetTrailer()
are totally what I was looking for. On the client side, grpc.Header()
and grpc.Trailer()
functions need to be passed to the RPC call, and their argument is a metadata.MD
object to be filled.
On the client side, define your receiving metadata:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install math-io
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page