亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

發布請求后無法顯示回復

發布請求后無法顯示回復

慕容森 2021-05-10 13:14:13
當我嘗試顯示帶有節點和請求的發布請求的答案時,我遇到了麻煩。我可以在使用中的控制臺中看到響應,但是它沒有進入控制器。為什么?Thaaaanks!這是代碼:function postData(req, res, next){    eventService.getItems()    .then(response => {        const result = response.body.items                const id = nameFilter.map(task => task.id =  null)        for(var i = 16 ; i < nameFilter.length; i++){            eventService.postData(nameFilter[i])        }     })     .then(response => {        console.log(response) // undefined        res.send(response)    })     .catch(error => {        console.log('error')        next(error)    }) }module.exports = {postData}服務  postData(data) {      return new Promise(function (resolve, reject) {      request.post({        headers: {          'Content-Type': 'application/json',          'Authorization': 'Bearer ' + '00002'        },        url: 'url ',        json: data      },       function (error, response, body) {        if (error) {          reject(error)        } else {          console.log(response.body) // shows the message          resolve(response.body)        }       });     })    }}
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 145 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號