1

I made a post request by using superagent:

var postUsage = function(postUsage_CB) {
    var expectedStatusCode =  201;
    var timeStart = new Date();
    request
        .post(serviceEndPoint)
        .send(object)
        .end(function(err, res) {

            resCode = res.statusCode;
            console.log('\n' + 'postUsage - res.statusCode = ',resCode);

            if (res.statusCode != expectedStatusCode){
              console.log('\n' + 'postUsage - res.text = ',res);
              throw 'POST usage failed';
            }
            else {
              header_location = res.headers.location;
              return postUsage_CB();
            }
        });
  };

While I see inside the response in the header, it says the request method is get. And also I could see in the log info of endpoint I am posting to, it showing the method is get. Anyone knows what's going on with it?

Qian
  • 11
  • 1
  • 3

0 Answers0