本地添加图片成功, add resource 待完善

This commit is contained in:
life
2015-01-28 00:38:34 +08:00
parent 75d2710e05
commit 256ebb6363
11 changed files with 172 additions and 66 deletions

9
node_modules/api.js generated vendored
View File

@@ -86,13 +86,17 @@ var Api = {
fs.writeFile('/Users/life/Desktop/aa.png', resp.body);
});
},
// 测试
uploadImage: function() {
var data = {
foo: 'bar',
image: { file: '/Users/life/Desktop/aa.png', content_type: 'image/png' }
cc: [1,2,3,3],
dd: {name: 'life', age: 18},
image: { file: '/Users/life/Desktop/imageplus.png', content_type: 'image/png' }
}
needle.post('http://localhost/phpinfo.php', data, { multipart: true }, function(err, resp, body) {
// needle will read the file and include it in the form-data as binary
console.log(resp.body);
});
},
getSyncNotebooks: function(afterUsn, maxEntry, callback) {
@@ -338,7 +342,8 @@ var Api = {
});
},
// 添加
// 添加笔记
// 要把文件也发送过去
addNote: function(note, callback) {
var me = this;
// note.NotebookId是本的, 要得到远程的