来自Web服务的响应始终是不确定的

时间:2019-11-21 22:31:40

标签: javascript promise javascript-objects

我正在尝试从Web服务获取响应。我打电话给我的函数 在Web服务中,我做了一些工作,最后得到了一个readablestream对象的response.body。我返回了这个对象,但是在应用程序的另一部分中,我无法使这个带有值的对象始终是未定义的。

这是我的代码:

pressReceiptHandler: function(pressReceipt) {
    this.pressReceiptObjectAsync({
        booking1: this.booking1,
        arrival
    }).then(response => this.pressReceipt(response)); 
    // response is always undefined but in web  
    // service in the is readablestream  
    // object before the return
},

0 个答案:

没有答案