Hello, I am using the REST endpoint of Prestashop, here the docs
If I run the endpoint in the browser it’s working fine, but on n8n side, it return me a 302 error.
Do you have any ideas?
What is the error message (if any)?
{"status":"rejected","reason":{"message":"302 - \"\"","name":"Error","stack":"Error: 302 - \"\"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at IncomingMessage.emit (node:domain:552:15)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)"}}
Can you enable redirects in the HTTP Request node and let me know if that helps. A 302 response typically means the server is asking the client (in this case n8n) to use a different URL and the client will automatically follow it so normally you won’t notice this sort of thing from curl or a browser.
Like the screenshot show, i am receiving a Cloudflare HTML login page , do you think is something that can be avoid with n8n request or it’s a problem on the prestashop side(?)
I guess the first thing I would check is if using a different user-agent header to see if that solves anything if you control the store and cloudflare settings you could possibly just add n8n to your allowlist so it skips the check.
What about something longer like n8n-automation? It can be tricky to know what Cloudflare are putting the page up for it could be too many requests from an IP. Is it actually the login page as well or is it another page and the title tag is just misleading?