Http headers error for multiple msgs

Hello everyone,

I am developing a flow that aims to divide a huge message into smaller messages. I have achieved all the logical part for dividing the msg, however, when sending all those small messages to a http response node I get the following error: "Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client". Of couse, I specified the headers in the http response node, but without any success so far.

It's important to mention that I get this error after the 1st small message is sent, so yeah, basically the following messages trigger this error.

Any idea how to resolve this error ?

Things that I've tried so far:
-Specify the headers in the http response.
-Put a function before the response node and specify the headers of the msg in the function itself.

Thank you !

just for confirmation, you're trying to send a streaming response with the http-in/http-response nodes?

If so, the http-in/http-response nodes do not natively support sending a streaming response. Each message passed to the http-response node needs a unique, connected req/resp objects coming from the http-in node. The connection closes as soon as you send your first message, meaning you can't keep sending more response data to it.

That's exactly what I am trying to make yes. If so, would there be any node that supported a streaming response as you mention ?

So sorry, I am kind of new to these topics.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.