title: How to make HTTP GET+POST request in Protractor
body: <p>I am facing problem to send HTTP get request in Protractor. Actually, I need to check data in DB after perform some action in UI.</p>
  
  <p>It will be very helpful if I will be able to do it using JQuery, but I am not able to find a way how to use JQuery inside Protractor.</p>
  
  <p>Need Help !!</p>
  
  <p>Actually, we did try to use the Node.js lib as shown below, but facing problems in it.</p>
  
  <pre><code>var http = require('http');
  
  var json_data;
  
  http.get('SiteUrl', function(response) {
      var bodyString = '';
      response.setEncoding('utf8');
  
      response.on("data", function(chunk) {
          bodyString += chunk;
      });
  
      response.on('end', function() {
  
          json_data = bodyString;
          console.log("1----&gt;" + json_data);
      });
  
  }).on('error', function(e) {
      console.log("There is an error in GET request");
  });
  console.log("2----&gt;" + json_data);
  </code></pre>
  
  <p>After Debugging, we have found that the problem is Protractor is not waiting for HTTP request to be complete and just pass on. We are getting <code>2----&gt;</code> first in console and then <code>1----&gt;</code>.</p>