Webhook 在 Delphi 中监听

huangapple go评论69阅读模式
英文:

Webhook listening in Delphi

问题

我正在尝试在Delphi中设置一个应用程序,用于接收WhatsApp-GupShup API的Web钩子。我之前已经处理过API,但没有处理过Web钩子,所以希望能得到一些指导。

我已经设置了一个托管API的Web模块,并创建了一个操作URL进行测试,但当我在GupShup API中使用它时,我的断点都没有触发,测试URL时显示'Callback set failed'。如果我尝试从浏览器访问URL,它可以正常工作并触发我的断点。我在这里看到GupShup将向URL发送一个带有演示机器人参数的GET请求,但如上所述,我的断点并没有触发,所以我陷入了困境。是否有人对我的情况有任何想法,并有关如何从Delphi应用程序接收Web钩子的建议吗?

英文:

I am trying to set up an application that will receive the web hooks from the WhatsApp-GupShup API in Delphi.
I have worked on API's before, but not on web hooks so some guidance will be much appreciated.

I have set up a Web Module that hosts an API and have created an Action URL to test, but when I use it in the GupShup API, none of my breakpoints fire and I get 'Callback set failed' when I test the URL.
If I try access the URL from my browser, it works and my breakpoints fire.
I have read on here that GupShup will send a GET request to the URL, with parameters for a demo bot, but as stated above my breakpoints don't fire, so I am at a standstill.
Does anyone have an idea on what my situation could be, and any advice on trying to receive web hooks from a Delphi application?

答案1

得分: 1

如果我尝试从浏览器访问该URL,它可以正常工作。

浏览器和Web模块运行在相同的网络中,因此浏览器发出的GET请求会触发Web模块的操作。

如果从GupShup发送GET请求,除非计算机可以接受来自互联网的传入连接,否则不会到达您的Web模块。

(如何使Web应用程序可以从互联网访问是一个不同的话题。)

英文:

> If I try access the URL from my browser, it works

The browser and the Web module are running in the same network so the GET request from the browser triggers the web module action.

If the GET request is sent from GupShup, it will not reach your web module unless the computer is accessible for incoming connectionns from the Internet.

(How to make a web application accessible from the Internet is a different topic.)

huangapple
  • 本文由 发表于 2023年2月10日 14:35:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/75407667.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定