var data = querystring.stringify({
"ID": 0,
"PropertyID": 197688,
"CheckIn" : "2016-01-25",
"CheckOut" : "2016-01-30",
"Renter": {
"FirstName": "Victor",
"LastName": "Smith",
"PrimaryEmail": "testOnUpwork@example.com"
}
});
var options = {
host: url,
path: path,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(data)
}
}
var req = http.request(options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
req.write(data);
req.end();
Возвращает BODY: { "error": { "message": "Value cannot be null.\r\nParameter name: value", "code": "0"}}
В чем может быть дело?