post - 与 POST http 方法相比,使用 GET http 方法更新值有什么优势?
问题描述
我正在阅读有关如何创建电报机器人的信息,我发现要设置网络挂钩,您可以使用 GET http 方法。我假设您的链接将存储在电报服务器上的某个地方。
所以现在我的问题是:为什么不使用 POST http 方法?在这种情况下使用 GET http 方法而不是 POST http 方法来推送数据的这种设计的优势是什么?
解决方案
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.
推荐阅读
- c# - 将托管 VS 测试项目中的 std::vector 传递给托管 Dll
- class - 网站 html 检查器 wc3validator 但显示致命错误
- android - GLTF 物体在加载时接地
- javascript - 将带有图像和标题的元标记添加到 Angular 6 项目
- android - 如何在 Android Studio 中从 Firebase 实时数据库中的 URL 检索图像
- python - python中的lzss.decode()没有给出正确的输出
- javascript - 仅打开一个带有角度的弹出选项卡
- sql - 如果没有找到 SQL 查询返回列 null
- reactjs - React JS 导航栏标题元素类型无效
- javascript - ESTree 中使用什么语言来描述抽象语法树?