我尝试使用Webhook获取JSON数据, 我了解到应该安装ngrok,因为Webhook无法在本地工作,所以我安装了ngrok, 并尝试按照此小教程进行操作:https://medium.com/@derek_dyer/rails-webhooks-local-development-7b7c755d85e3
我创建了我的路由:
get 'invoice/webhooks'
post 'invoice/webhooks' =>'invoice#webhooks'
我的控制器:
def webhooks
render json: response.body, status: 200
end
我还把我的网址:https://ce0d99f7.ngrok.io/invoice/webhooks 插入到我的服务中,以接收Webhook。
我在终端中运行了命令:./ngrok http 3000,然后我收到了一条消息。
POST /invoice/webhooks 403 Forbidden
有人知道如何修复这个问题吗?