I need to create url for get which is going to accept array, how in node.js/express extract array from request?

One option is using a JSON format.

http://server/url?array=["foo","bar"]

Server side

var arr = JSON.parse(req.query.array);

Or your own format

http://server/url?array=foo,bar

Server side

var arr = req.query.array.split(',');

Leave a Comment