var body = {simpleField: 'text',complexField: { name: 'text', value=42 }};var options = { method: 'POST', dataType: 'json', data: body };urllib.request(url, options, function(err, json, res) {//check responce};
I was very surprised when I found out that the body is not sent as json (application/x-www-form-urlencoded). But I was even more surprised when I found out that some fields are missing in the body!
Is this a mistake in your code, or am I a fool and using a brilliant tool incorrectly?
I use the library like this:
var body = {
simpleField: 'text',
complexField: { name: 'text', value=42 }
};
var options = { method: 'POST', dataType: 'json', data: body };
urllib.request(url, options, function(err, json, res) {
//check responce
};
I was very surprised when I found out that the body is not sent as json (application/x-www-form-urlencoded). But I was even more surprised when I found out that some fields are missing in the body!
Is this a mistake in your code, or am I a fool and using a brilliant tool incorrectly?