Curl Node Request

I’ve spent over half an hour trying to figure out how to send an http post request, which would have been so much simpler if I could just paste the ‘curl’ command. Postman also lets be export the request as a curl command.

There is also a simple node library to parse curl - GitHub - NickCarneiro/curlconverter: convert curl commands to Python, JavaScript, PHP, R, Go, Rust, Dart, JSON, Ansible, Elixir

I might be willing to build such a node and contribute it, I thought I’ll make a feature request first.

Hi @vhanda,

Don’t forget to hit that vote button to make it count, What you could do depending on how you have n8n installed is use the curl command through the execute node.

Maybe the HTTP node could do with an “advanced” option that allows it to work more like Curl, Out of interest what did you have a problem doing with the HTTP node?

2 Likes

Hi @vhanda, thanks so much for reaching out!

In addition to what @jon has already said: If a certain binary (such as curl in this case, but also anything else) is crucial for your workflow, you can always resort to the Execute Command node as a last resort.

So if curl is already available to your instance, you can just paste your curl command in there. If you are using Docker, the documentation linked above would have an example of how to build a Docker image including curl (this will, however, not be possible when using n8n cloud).

3 Likes

Sometimes when I cannot figure what the curl command at hand is doing, I would go to Postman, paste the curl request, and finally get the code snippet using the request library (check the image below). It is much easier to set up the n8n HTTP node since its design is based on the request library. I hope that makes sense.

1 Like

would be good if we can paste a curl command into some “input box” and n8n would ingest that and turn it into an HTTP node request with all the curl information added to it automatically.

2 Likes

Yep, this would be really useful. We have a whole list of things we’d like to improve around the HTTP node (including this one), but a lot of them are breaking so we’d like to do them all at once.

2 Likes