How to get header value from Streaming.
See original GitHub issueHello!
I do have a simple endpoint that streams objects from the database. In headers, I’m sending extra header with information about the total amount of items. The header is called total_count

I’m seeing the value in the response header in the network debugger. However, I’m unable to get it using your framework.
const headers = new grpc.Metadata();
headers.set('authorization', login?.accessToken || '');
const response = client.listDemoObjects(req, headers);
const items: DemoObject.AsObject[] = [];
let totalItems: number;
response.on('status', (status) => {
console.log(status.code);
console.log(status.details);
console.log(status.metadata); // total_count is not here
});
response.on('end', (status) => {
console.log(status); // total_count is not here
});
response.on('data', (data) => {
items.push(data.toObject()); // total_count is not here
});
How can I get response headers?
To be 100% clear I’m not using trailers. 😃
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to get the header values from streaming API response
We are using Icecast streaming server for online radio, how do we get the api response header values. like. icy-description: Online Radio ...
Read more >Configuring HTTP Headers, Streaming, and Buffering (Real ...
Use the Set HTTP Response Code VI and the Set HTTP Response MIME Type VI to customize the response code and MIME type...
Read more >How to Read HTTP Headers in Spring REST Controllers
First, we'll be using the @RequestHeader annotation to read headers individually as well as all together. After that, we'll take a deeper look ......
Read more >IHTTPResponse (Wowza Streaming Engine 4 API)
Method Summary ; Get header value · Get the current response headers as a map · Get the size in bytes of the...
Read more >Replace a header value with stream - DevCentral
In the response, i get a 302 back. in this 302er I want to replace the protocol. ... enabled for subsequent HTTP requests...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As noted here you should be able to read the response headers in the
"metadata"
event. TheGrpcWebClientReadableStream
implementation directly reads the response headers from the xhr event and will emit the corresponding event.Hello!
You have to add an additional header in the envoy server so that grpc lib will be able to use it. In my case it was.
I’m closing this issue as not an issue.