app.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:iris-relay 作者: linkedin 项目源码 文件源码
def on_post(self, req, resp):
        """
        Accept twilio SMS webhook and forward to iris API
        """
        try:
            path = self.config['iris']['hook']['twilio_messages']
            re = self.iclient.post(path, req.context['body'], raw=True)
        except MaxRetryError as e:
            logger.error(e.reason)
            self.return_twixml_message('Connection error to web hook.', resp)
            return

        if re.status is not 200:
            self.return_twixml_message(
                'Got status code: %d, content: %s' % (re.status,
                                                      re.data[0:100]), resp)
            return
        else:
            body = process_api_response(re.data)
            self.return_twixml_message(body, resp)
            return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号