TwilioのHTTP取得エラーで、いくつかの質問がありました。Twilio 11200 HTTP取得失敗 - これはどういう意味ですか?
Expressを使用してNode.jsメッセージングサーバーをすぐに実装した後、私はこのエラーを一貫して打ち始めるようになりました。私のテキストメッセージの応答が10〜20秒遅れることがあり、デバッガに表示されることがあります。
ここに明白なものがありますか? Twilioのサンプルコードを使用しているので、これは箱の中でうまくいくはずです。
app.post('/sms', (req, res) => {
const data = req.body
const message = data.Body
const sender = data.From
console.log('We\'ve received a text...')
console.log('Sender: ', sender)
console.log('Message: ', message)
const responses = [
'Message #1.',
'Message #2.',
'Message #3.',
'Message #4.'
]
client.sendMessage({
to: '+11231231234', // Any number Twilio can deliver to
from: '+11234564567', // A number you bought from Twilio and can use for outbound communication
body: responses[ Math.floor(Math.random() * 4) ] // body of the SMS message
}, function(err, responseData) { //this function is executed when a response is received from Twilio
if (!err) { // "err" is an error received during the request, if any
console.log(responseData.from); // outputs "+14506667788"
console.log(responseData.body); // outputs "Printing some stuff."
}
});
})
すべてのアイデアは、私が間違ってやっている、および/またはどのようにこの問題を解決するために、次のよう
私のコードはありますか?ありがとうございました!