I wanted to know, how to pass the json request in the payload, for eg: {\'name\' : \'test\', \'value\' : \'test\'}
:
var post_data = {};
var post_op
i tried this and it seems to be working.I needed basic auth so i have included auth,if you don't need it you can discard it.
var value = {email:"",name:""};
var options = {
url: 'http://localhost:8080/doc/',
auth: {
user: username,
password: password
},
method :"POST",
json : value,
};
request(options, function (err, res, body) {
if (err) {
console.dir(err)
return
}
console.dir('headers', res.headers)
console.dir('status code', res.statusCode)
console.dir(body)
});