我在使用nodejs尝试以下PUT请求时遇到错误。
SELECT ROW_NUMBER() OVER (ORDER BY UID_DIVISION, UID_CUSTOMER, INT_GROUP_BY, INT_SORT_ORDER) AS aRowNumber,
100 * DENSE_RANK() OVER (PARTITION BY INT_GROUP_BY
ORDER BY UID_CUSTOMER
) AS aINT_GROUP_BY,
5 * ROW_NUMBER() OVER (PARTITION BY UID_DIVISION, INT_GROUP_BY
ORDER BY UID_CUSTOMER, INT_SORT_ORDER
) AS aINT_SORT_ORDER,
UID_DIVISION, UID_CUSTOMER, UID_VEHICLE, INT_GROUP_BY, INT_SORT_ORDER, TXT_GROUP_NAME
FROM tVEHICLES TV
ORDER BY UID_DIVISION, UID_CUSTOMER, INT_GROUP_BY, INT_SORT_ORDER;
ERROR:
var request = require('request');
request('http://1xx.xxx.xxx.xxx:8080/maintable/http%3A%2F%2Ftesturl.com
%2F',
method: 'PUT',
json:{"Row":[{"key":"aHR0cHM6Ly9tYWt6ZW9uLndvcmRwcmVzcy5jb20v", "Cell":
[{"column":"YmxvZ3NfZGF0YTp1cmw=", "$":
"aHR0cHM6Ly9tYWt6ZW9uLndvcmRwcmVzcy5jb20v"},
{"column":"YmxvZ3NfZGF0YTppbnNlcnREYXRl", "$": "MTQ5Njg3ODk1OA=="},
{"column":"YmxvZ3NfZGF0YTpzdGF0dXM=", "$": "QWN0aXZl"}],
}]},
function (error, response, body) {
console.log('error:', error);
console.log('statusCode:', response && response.statusCode);
console.log('body:', body);
}
);
是否有人注意到错误的位置?
答案 0 :(得分:1)
错过' {'对于请求函数的第一个参数
var request = require('request');
request({
uri: 'http://1xx.xxx.xxx.xxx:8080/maintable/http%3A%2F%2Ftesturl.com',
method: 'PUT',
json:{
"Row":[
{
"key":"aHR0cHM6Ly9tYWt6ZW9uLndvcmRwcmVzcy5jb20v",
"Cell": [
{
"column":"YmxvZ3NfZGF0YTp1cmw=",
"$": "aHR0cHM6Ly9tYWt6ZW9uLndvcmRwcmVzcy5jb20v"
},
{
"column":"YmxvZ3NfZGF0YTppbnNlcnREYXRl",
"$": "MTQ5Njg3ODk1OA=="
},
{
"column":"YmxvZ3NfZGF0YTpzdGF0dXM=",
"$": "QWN0aXZl"
}
],
}
]
}
},
function (error, response, body) {
console.log('error:', error);
console.log('statusCode:', response && response.statusCode);
console.log('body:', body);
});