Is there a way to get the headers of SUCCESSFUL https request?
Most of the threads and questions are on the ones that produce errors, but we’re not finding a way to check for headers of successful ones? Some sort of log of a request that was sent.
both - actual request and response headers that were sent are not visible (or we can’t find it).
Hi @ZilvinasB, welcome to the community! There is indeed a way to do this using the HTTP Request node. It comes with the Full Response option which would give you an additional headers field as well as the status code.
Found it for response. Thanks.
@MutedJam , the said option includes only the result, i.e. RESPONSE headers. However this option (or any other options) does not include full REQUEST headers that were sent to URL.
Hi @ZilvinasB. You’re right and I’m sorry to have missed that part of your question. The request headers aren’t returned as items by the HTTP Request node, but can be accessed through it’s parameters in subsequent nodes. E.g. when setting your headers as a JSON object in the HTTP Request node, you can read them in other nodes with an expression like {{JSON.parse($node["HTTP Request"].parameter["headerParametersJson"])}}
:
This is an example workflow demonstrating the idea:
I hope this helps! Give me a shout if you have any further queries on this!
I need to see the request headers too, but I don’t have headerParametersJson
in HTTP Request node, only `headerParametersUI and that only includes the headers I’ve configured myself.
I have a HTTP service that requires a custom Accept header. I have it working in RESTer plug-in, but it’s failing in n8n, and I suspect the Accept header to be the culprit
Hi @mattesilver, a very simple way to see your request headers would be to (temporarily) use a Hookbin URL. This would let you inspect the full request so you can experiment with it.
E.g. when setting a custom accept
header, I can see it’s working as expected when writing the header name in all lowercase:
1 Like