I am writing a NodeJS application to test the IBM MobileFirst Platform adapters that I have written. The approach I want to follow to do this, as follows:
The problem with approach is that, when I try to make a request to the testtoken end point, I am getting an HTTP 405 status error. However, the same works with PostMan.
Is there a way to make this work in the NodeJS application? I am using Request to send requests to the MobileFirst Server.
I am writing my NodeJS application using SailsJs.
The test token operation requires POST request.
request.post('http://localhost:10080/app/authorization/v1/testtoken', function(error, response, body) {
console.log(response.statusCode);
if(!error && response.statusCode == 200) {
console.log(body);
return res.ok(body);
} else {
return res.notFound(error);
}
});
In my case, I was using Request so the above code worked.