HTTP request node curl POST

Hy There!
I’d like to get curl response from threatfox abuse.ch, from the website API doc they give curl command that I can used.

curl -X POST https://threatfox-api.abuse.ch/api/v1/ -d '{ "query": "ioc", "id": 41 }'

Error node said that method using is not allowed

Please share your workflow

Need assistance on how to make it right and get a response from the curl command, thanks!
Regards

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Additional information,
I add curl in “Import cURL”

Hey @security_sec,

That is interesting, I have it a test in curl and it worked and I get the same error when checking from n8n. I have changed the URL for another one to test against webhook.site and it looks like we are sending a post request so I think the API is objecting to something else…

Was about to hit send and tried again and I worked it out… When using import from curl we are removing the trailing slash for some reason, If you add that back into the URL it then works as expected. Testing without a slash in Curl shows a 301 so it looks like we don’t follow the redirect but adding that slash back should sort this out.

Hey @Jon

Sorry, i’m a newbie at this.
What do you mean by removing the trailing slash. Is it to change the URL in import from curl without the trailing slash? like this?

curl -X POST https:threatfox-api.abuse.ch/api/v1/ -d '{ "query": "get_iocs", "days": 7 }'

Is it work for you?

Hey @security_sec,

Once importing from curl add a / to the end of the URL like the image below, When importing from curl we seem to be removing it but the API you are using needs it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.