daghan
November 12, 2021, 7:12am
1
Hey, I was testing HTTP requests via Postman and everything was great.
I picked the HTTP node on n8n and tried to send the same HTTP PUT request but I’m constantly getting 415 responses.
HTTP Put request I’m sending: no request body etc. It’s just a URL.
I copy and past the same endpoint in HTTP node but the response is 415.
Do you know what’s wrong here?
daghan
November 12, 2021, 7:13am
2
I used HTTP node before many times and did not such problems before.
Jon
November 12, 2021, 7:30am
3
Hey @daghan ,
415 normally means the content type is wrong (415 Unsupported Media Type - HTTP | MDN )
Could be worth seeing what headers the server is expecting.
daghan
November 12, 2021, 7:51am
4
So I send this request to HubSpot’s API but I did not see anything special about headers.
If it returns 200 via Postman then it’s the n8n HTTP node that runs things differently. Thus 415.
Do you know what actions I can take to solve this? I want this http request to return 200 on n8n as well.
Jon
November 12, 2021, 10:03am
5
Hi @daghan ,
I would be checking the headers that n8n is sending and what postman is sending maybe with something like Pipedream. Could try enabling the JSON / RAW option and having nothing set as well. How do you have n8n installed is it the cloud version, desktop or docker / npm and is it sat behind a proxy or anything?
I wonder if n8n is sending an empty body {},
hence the error. That’s the only difference I can see.
It looks like Axios is setting the content-type application/x-www-form-urlencoded
by default. Go to the parameter MIME Type
under options and set it to application/json
daghan
November 12, 2021, 1:14pm
9
Hi @Jon and @RicardoE105
I’m using n8n cloud. I just tried Ricardo’s advice about MIME Type and it worked!
Thank you @Jon and @RicardoE105 for helping me out with this!
3 Likes
krynble
November 15, 2021, 11:28am
10
Hi everyone.
I created a fix for this that can be found here: Removing default headers for PUT and PATCH by krynble · Pull Request #2434 · n8n-io/n8n · GitHub
Should be released soon!
Thanks for reporting!
2 Likes
jan
November 19, 2021, 6:21pm
11
Fix got released with [email protected]