HTTP Request Returns 415 Surprisingly

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?

I used HTTP node before many times and did not such problems before.

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.

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.

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

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! :slight_smile:

3 Likes

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

Fix got released with [email protected]