首页 > 解决方案 > 与 POST http 方法相比,使用 GET http 方法更新值有什么优势?

问题描述

我正在阅读有关如何创建电报机器人的信息,我发现要设置网络挂钩,您可以使用 GET http 方法。我假设您的链接将存储在电报服务器上的某个地方。

所以现在我的问题是:为什么不使用 POST http 方法?在这种情况下使用 GET http 方法而不是 POST http 方法来推送数据的这种设计的优势是什么?

标签: postgetwebhooks

解决方案


Bot API supports GET and POST HTTP methods both. It's up to you what to use. (See this or this). I think it makes the API easy and fast to get started with.

For the sake of simplicity one might choose a simple GET request to set a webhook - Put together a Url with some parameters and call it in a web browser, done! Webhook is now set.

Still it is possible to do the same with a POST request (and you can argue it is the preferred way to do so). But it would need tools like Postman, CURL or some browser extensions.


推荐阅读