我使用此代码上传图片: https://github.com/NativeScript/sample-ImageUpload
当我上传图片时,我收到了成功通知。 我正在尝试从服务器读取响应并检查任务的完整事件:
task.on("complete", logEvent);
function logEvent(e) {
console.log(JSON.stringify(e));
}
这是输出:
{"eventName":"complete","object":{"_observers":{"complete":[{}],"propertyChange":[{}]},"_session":{"_id":"image-upload"},"_id":"image-upload{1}","_description":"{ 'uploading': Test0.png }","_upload":3807297,"_totalUpload":3807297,"_status":"complete"},"response":{}}
您可以看到响应为空。那么如何从服务器读取响应呢?