Timeout error when trying to get hosted csv file

From an html page I am calling a function that should get a csv file hosted in backendless and return the contents in the response body. Whenever I try to execute the script I get a 504 timeout error. Here is the code of the script I am calling:

var csv_request = require(‘request’);

exports.run = function( request, response )
{
csv_request.get(“https://api.backendless.com/B75DC8E3-A4F2-255C-FF29-BE5B2377B400/v1/files/import/challenges/challenges_07_09_15.csv”, function (error, response, body) {
var csv = body;
response.send(csv);
});
}

If I access the URL directly for the csv file in a browser it downloads fine. What am I doing wrong?

Hi!

Could you try to change line

csv_request.get("xxx[url=https://api.backendless.com/B75DC8E3-A4F2-255C-FF29-BE5B2377B400/v1/files/import/challenges/challenges_07_09_15.csv%22]"[/url], function (error, response, body)

to

csv_request.get("xxx[url=https://api.backendless.com/B75DC8E3-A4F2-255C-FF29-BE5B2377B400/v1/files/import/challenges/challenges_07_09_15.csv%22]"[/url], function (error, res, body) 

and run script again?
Regards,
Kate.

Thanks very much, that worked!