title: how to make post call using superagent
body: <p>I am using following code to make an Post call using superagent </p>
  
  <pre><code>process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
  var request = require( "superagent" );
  var PostUrl = 'http://example.com/rest/api/someapi';
  
  var body = ["true"];
  var data = JSON.stringify(body);
  console.log("data: " + data);
  
  request.post( PostUrl ).send('[true]').set('Content-Type', 'application/json').auth('user', 'pass').end(function(err,res){
      if(err){
          console.log("CreateUsers post error = ", err )
      } else {
          console.log("CreateUsers post response = ", res.status)
          console.log(res.body);
      }
  });
  </code></pre>
  
  <p>Error says that its not able to find the api. If I use postman to make same restapi call using 'POST' method; it works fine.</p>
  
  <p>Also, when i looked at error object, the method mention there is 'GET' and not 'POST'.</p>
  
  <p>Here is the request header that i got when i printed the response object</p>
  
  <pre><code>_header: 'GET /zebi/api/haService/getLocalNodeName HTTP/1.1\r\nHost: 10.67.1.61\r\naccept-encoding: gzip, deflate\r\nuser-agent: node-superagent/3.3.0\r\nauthorization: Basic YWRtaW46dA==\r\nConnection: close\r\n\r\n',
  </code></pre>
  
  <p>Can someone please help me with this.</p>