Closed memstone closed 7 years ago
The GET method can only be invoked once when you activated the Callback Mode at the Wechat console. However, all the callback actions that wechat server performs use POST method.
2017-03-23 14:51 GMT+08:00 memstone notifications@github.com:
app.use('/wx', wechat(wx_config, wechat.text((message, req, res, next) => { res.reply([{title:'demo', description:'skdkd', picurl:'http://images.csdn.net/20170322/no1.jpg', url:'http://geek.csdn.net/news/detail/188258' }]); }).event((message, req, res, next)=>{ console.log('evet...'); console.log(message); res.reply('hello event.'); })));
app.get('/wx', (req, res) => { console.log('not processed.'); res.reply('Your message not supported yet.'); });
以上的代码,不会执行 app.get,需要怎么编码?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/node-webot/wechat/issues/265, or mute the thread https://github.com/notifications/unsubscribe-auth/ABq-98yydTEXwRMuzj5AtOEqmAlnyv7bks5rohaIgaJpZM4MmTSg .
@nick-ma thank u very much. after change GET to POST, then it works.
You are welcome and issue closed.
app.use('/wx', wechat(wx_config, wechat.text((message, req, res, next) => { res.reply([{title:'demo', description:'skdkd', picurl:'http://images.csdn.net/20170322/no1.jpg', url:'http://geek.csdn.net/news/detail/188258' }]); }).event((message, req, res, next)=>{ console.log('evet...'); console.log(message); res.reply('hello event.'); })));
app.get('/wx', (req, res) => { console.log('not processed.'); res.reply('Your message not supported yet.'); });
以上的代码,不会执行 app.get,需要怎么编码?