在 nodejs 專案中, 若是需要對外發起使用 application/json 的 http post , 若有中文字, 需要注意計算字串長度的問題. 一般發起的程式碼請參考:
http://tech.pro/tutorial/1091/posting-json-data-with-nodejs
不過該範例是使用英文字, 所以沒有問題, 若是要發起中文字的 json http post, 需要調整計算 Content-Length 的方式, 使用 new Buffer(str).length, 如下:
var obj_json = { name: "王大頭", age: 25 };
var json_string = JSON.stringify(obj_json);
var req = http.request({
host: 'host.example.com',
port: 80,
path: '/upload',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': new Buffer(json_string).length
}
}, function(res) {
res.setEncoding('utf-8');
var responseString = '';
res.on('data', function(data) {
responseString += data;
});
res.on('end', function() {
console.log(responseString);
});
});
req.on('error', function(e) {
// http post error
});
req.write(json_string);
req.end();
(無法安裝應用程式, 因為 xxxx 的憑證無效), 誰看得出來這個訊息是什麼意思, 查了一下, 發生的原因原來是因為原本在網頁上的安裝連結:
若不介意 dl.dropboxusercontent.com 的這個訊息, 這就可以進行安裝了, 是用 dropbox 的 https 來解決這個 iOS 7.1 強迫要用 https 下載 plist 的問題.

而 right join (也就是 right outer join), 則是取出以右邊為主, 不管左邊是否存在的資料, 如:
