【发布时间】:2020-10-12 08:18:55
【问题描述】:
我在 Node.js 中使用标准应用引擎配置。我在使用 xmlhttprequest 从应用引擎访问 ibm cloudant 时遇到问题。
我用于应用引擎请求的代码如下:
var getAllDocuments = function(database, callback) {
var xhr = new XMLHttpRequest();
xhr.open("GET","<link>" + database + "/_all_docs?include_docs=true", false);
xhr.setRequestHeader("Authorization", myauthenticateUser(userName, passWord));
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onreadystatechange = function (){
if (xhr.readyState == 4 && xhr.status == 200) {
var data = JSON.parse(xhr.responseText);
callback(data, xhr.status);
}
else{
callback(null, xhr.status);
}
}
xhr.send();
}
执行上述代码时会发生以下错误-: Error: EROFS: read-only file system, open '.node-xmlhttprequest-sync-11'。
仅供参考:我没有在我的应用引擎中保存任何临时文件。
有什么要添加到我创建的 yaml 文件中的,还是其他的?
【问题讨论】:
标签: node.js google-app-engine xmlhttprequest cloudant