title: GET Ajax returns html code in response instead of json object
body: <p>I have an ajax get request as below. I am making a GET request to server.js in openshift using nodejs express. However, i get html contents in the response method instead of json object. Both the requests are for the same domain.The node modules that I am using are moongojs,mongodb and bson.</p>
  
  <pre><code>$.ajax({
             type: "GET",
             url: "http://abc-favspot.rhcloud.com",
             contentType: "application/json",
             data: JSON.stringify(currLocation),
             dataType: "text",
             success: function(response){
             callback(response);
                 },
              error: function( error ){
              console.log( "ERROR:", error );
  
                  }
              });
  </code></pre>
  
  <p>My server.js file has the following code</p>
  
  <pre><code>self.routes['getData'] = function(req, res){
          console.log("gat method");            
  
      self.db.collection('location').find().toArray(function(err, names) {
         res.header("Content-Type:","application/json");
          console.log("success get");            
          res.send(names);
      });
    };
  </code></pre>