HTTP Request Function Node

Hi everyone,
I would like to know if it were possible to send HTTP requests (i.e. fetch) in function nodes in n8n cloud.
Thank you in advance.

Hi @Alberto_Marzetta, welcome to the community!

To make HTTP Requests right inside the Function node when using, you could use request-promise-native and run a snippet like this:

const request = require('request-promise-native');

const options = {
  uri: '',
  method: 'GET',
  json: true

let result = await request(options);

return [{
  json: result.meals[0]

Is this what you had in mind?

Thank you! yes. I had to do some basic authentication which I managed with ‘Request’ module.Thanks again

1 Like

is there a way to do this on self hosted, this code produces “ERROR: Cannot find module ‘request-promise-native’ [Line 170]”