Override Accept Header in Http Request

Hi, I am trying to create a repository dispatch event in Github invoked by a third party (n8n).
For this I created a HTTP request node in n8n which is meant to send a POST request to Github & trigger the dispatch. The problem is Github requires a custom Accept header “application/vnd.github.dorian-preview+json” in order to trigger the dispatch.
However I cannot seem to be able to override the default Accept Header in n8n :frowning: Can anyone give me some insight on a potential workaround?

Welcome to the community @stuci!

Did just test and it worked totally fine for me. Here the workflow:

And here the command to test:
curl -X POST -D - http://localhost:5678/webhook-test/ed8891c3-114a-43ad-827f-e755556b0887

The output I got:

HTTP/1.1 200 OK
X-Powered-By: Express
Access-Control-Allow-Origin: http://localhost:8080
Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, sessionid
A`Preformatted text`ccept: application/vnd.github.dorian-preview+json
Content-Type: application/vnd.github.dorian-preview+json; charset=utf-8
Content-Length: 35
ETag: W/"23-oDXMYq3oYYmi7auuVaxD2QFztMg"
Vary: Accept-Encoding
Date: Thu, 27 Aug 2020 18:27:10 GMT
Connection: keep-alive

{"message":"Workflow got started."}j

Additionally did also set conten-type. Is not needed for it to work just in case Github also wants that set.

Thank you for the fast reply @jan!

However you have set up a “Webhook Node”, what I need is an “HTTP Node” which sends a request to Github API. Setting the Accept Header to the HTTP is the thing which I cannot wrap my head around.

Ah sorry did totally over read the HTTP request part.

Yes that is correct. That node did always set it automatically depending on the content which did get sent. Just released a bug-fix version [email protected] which does only do that now if the “accept” header is not set. For it to work make, however, sure that the you write it lowercase.

Thanks Jan for the tip of the lowercase for “accept” header. you saved the day.

Welcome to the community @Bala_Sista!

Happy to hear it was helpful!

Have fun with n8n!