Q:

GET request, with data

What is the equivalent of the following browser-side GET request in Node?
jQuery.ajax({
    url: 'http://test.com',
    type: 'GET',
    data: myData,
    success: function(data) {
        console.log(data);
    }
});

My best attempt is
http.get('http://test.com', function(response) {
   response.on('data', function (chunk) {
      console.log(chunk);
   });
});

The problem is I don't know how to pass data: myData in the Node version. How can I pass data to http.get requests?

A:

You have to pass it the full URL. you can create the URL by adding the query parameters yourself. There is a helper for making your own Query Strings. So it would be something like:
url = "http://test.com/?" + querystring.stringify(myData);
http.get(url, ...);

