Adding http response headers

27 views
Skip to first unread message

Guy Pardon

unread,
Oct 29, 2020, 9:29:16 AM10/29/20
to grpc.io
Hi,

We are trying to add HTTP response headers on a service call and want to extract them on the client side. There does not seem to be a lot of documentation on how to do it, so does anybody have any hints? We are using Java...

Thanks!
Guy

Eric Anderson

unread,
Nov 2, 2020, 4:14:10 PM11/2/20
to Guy Pardon, grpc.io
HTTP headers are delivered via Metadata. You will need to use a ClientInterceptor. HttpUtils.newCaptureMetadataInterceptor() can be used for quick-and-dirty solutions. If you need to do that commonly, I'd suggest making a custom interceptor. Although it's hard for me to recommend anything specific since I don't know what you're doing with the header.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/e35e5939-8b9a-4501-9aa0-146ff71781d3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages