根据微软Document,我必须遵循以下步骤:
如果侦听器服务成功验证了URL,则返回a 5秒内成功响应如下:
- 在响应标头totext \ plain。
中设置内容类型- 在响应正文中包含相同的验证令牌。
- 返回HTTP 200响应代码。监听器可以随后丢弃验证令牌。
醇>
我的观点是这样的:
@app.route('/outlook/push', methods=['POST'])
def outlook_push():
return (request.args.get('validationtoken'), 200, {'Content-Type': 'plain/text'})
但exceeds
时间为limit(5s)
我收到这样的错误:
{'error': {'code': 'ErrorInvalidParameter', 'message': "Notification URL 'https://5cbae04e.ngrok.io/outlook/push?validationtoken=NmIzZDJiMTMtZjhmNy00ZWMwLTg1MDctNDQwMDQ0OWM2NmE1' verification failed 'System.Net.WebException: The operation has timed out\r\n at System.Net.HttpWebRequest.GetResponse()\r\n at Microsoft.Exchange.OData.Model.Notifications.PushNotification.PushSubscriptionCallbackUrlValidationHelper.SendRequestAndVerifyResponse(Uri callbackUrl, PushSubscription pushSubscription)'."}}
无论如何都要增加时间限制?
答案 0 :(得分:0)
我认为它无法更改,您的问题可能是您的路由被定义为接受POST方法。 office365正在那里提出GET请求:)