I copied gupshup's document code and modified just url as "http://posttestserver.com/post.php" and it doesn't work.
Anyone has an advice for me?
else if(event.message.toLowerCase() == "post") {
var contextParam = {
"User": {
"userName": "sbCobxxxx",
"Password": "xxxxxxx-9f-4307-9d9a-451f3xxxx075",
"Pin": "16776"
}
};
var url = "http://posttestserver.com/post.php";
var param = JSON.stringify(contextParam);
var header = {"Content-Type": "application/json"};
context.simplehttp.makePost(url, param, header);
}
function HttpResponseHandler(context, event) {
// if(event.geturl === "http://ip-api.com/json")
context.sendResponse(event.getresp);
}
Response returns empty string: ""
Thanks in advance.