Good morning guys,
I am trying to send a message from the simulator to a website, but there is something wrong in the message preventing the website from working and I cannot figure out what it is. This is the CURL equivalent of what I need to send that is tested and works:
curl -X "POST" -H "Content-Type: application/json" -H "x-master: \$2b\$08\$zI0DtY40FP6niScxucAxc.googlywoogly" --data '{"username":"socrates", "password":"123"}' https://madeup.com/api/createuser
And my app
function createUser() {
var url = "">madeup.com/.../createuser";
var params = {
"username" => "fiddy",
"password" => "fiddy"
};
var options = {
:method => Communications.HTTP_REQUEST_METHOD_POST,
:headers =>{
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON,
"x-master-token"=> "$2b$08$zI0DtY40FP6niScxucAxc.googlywoogly"
},
};
var responseCallback = method(:onReceive);
Communications.makeWebRequest(url, params, options, responseCallback);
}
Any ideas what is wrong?