title: Request callback with node
body: <p>I'm trying to create a callback function, but keep getting told that <code>data is not a function</code>. I've set it up according to another question, but does not seem to work?</p>
  
  <pre><code>getRequest("http://", function(error, data){
    console.log(data);
  });
  
  function getRequest(url, error, data) {
    request({
        method: 'GET',
        uri: url,
        headers: {
          'Content-Type': 'application/json',
          'dataType': 'json'}
      }, function (error, response, body){
        if(!error &amp;&amp; response.statusCode == 200){
  
          data(JSON.parse(body));
  
        } else {
          error(error);
        }
      })
  }
  </code></pre>