Nested http requests inside an http endpoint

I'm trying to do an http request inside an http endpoint but am running into an error:

Error: Can't set headers after they are sent

I've tried deleting msg.headers, msg,statusCode and other items on msg but I always get that error. Looking at the http nodes (not digging into the source code) it appears this should work fine - ie: they don't walk on each other variables - msg.res and msg.req shouldn't be written on - but as I said I haven't yet dug into the source of the respective http nodes recently.

I've tried saving copies of msg.res and msg.req but I get other errors..

Anyone have any guidance on what to try next?


That error is normally caused by passing two messages to the HTTP Response node for the one original request.

What does your flow look like?