var http = require('http')
function getSPARQLResults(query_string, callback) {
  sparqlQ = getSPARQLPrefix() + query_string;
  var options = {
    host: 'localhost',
    port: 8080,
    path: '/openrdf-sesame/repositories/myRepo?query=' +encodeURIComponent(sparqlQ) + '&content-type=application/sparql-results+json',
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Accept': 'application/sparql-results+json',
    },
  };
  //console.log ( encodeURIComponent(query_string) );
  console.log ( query_string );
  var req = http.get(options, function(res) {
    console.log("Got response: " + res.statusCode);
    console.log('HEADERS: ' + JSON.stringify(res.headers));
    var data = "";
    res.on('data', function (chunk) {
      data += chunk;
    });
    res.on('end', function () {
      console.log (data);
    });
  }).on('error', function(e) {
    console.log("Got error: " + e.message);
  });
  req.end();
}
RESPONSE (When node.js server is running on Amazon EC2 Linux Instance)
Got response: 400
HEADERS: {"date":"Wed, 24 Apr 2013 04:12:12 GMT","content-language":"en-US","content-type":"text/plain; charset=utf-8","content-length":"86","server":"Jetty(6.1.26)"}
undefined:1
MALFORMED QUERY: Lexical error at line 1, column 7.  Encountered: "%" (37), af
^
RESPONSE (When node.js server is running on Ubuntu laptop)
Got response: 200
HEADERS: {"date":"Wed, 24 Apr 2013 04:20:37 GMT","vary":"Accept","content-language":"en-US","content-type":"application/sparql-results+json; charset=UTF-8","content-disposition":"attachment; filename=query-result.srj","transfer-encoding":"chunked","server":"Jetty(6.1.26)"}
Content-Type is different between the two headers. What is missing/going wrong??
				
				there was a node version issue here. I had v0.8.17 on my laptop and I installed latest on EC2 instance which somehow broke something. Going back to node 0.8.17 on EC2 fixed the issue