var request = require('request');
var options = {
url: 'https://connect1on1.com/api/web/index.php/v1/message/save-message',
method:'POST',
body:JSON.stringify({"id": data.user_id, "message": data.message}),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': data.length,
'Access-Token': data.access_token
}
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(error);
// var info = JSON.parse(response);
}
}
request(options, callback);
I have add npm-request package for api call.
I have set all params in options and pass second option as callback function.
but i am getting this error. "Invalid Uri"
My question is how can i call secure https url in npm-request