实现 HTTP 可靠性
我的应用程序是一个桌面客户端和一个 Web API 应用程序。我正在编写这两个程序。
互联网会丢弃旧的请求吗?如果只是旧请求或重复请求,有什么区别吗?
重试 HTTP 请求是确保 HTTP 上几乎完全的端到端可靠性的唯一方法,还是有某种方法通过仅设置参数或标头而不使用 SOAP 来实现 SOAP 级别的可靠性?我的应用程序不使用 SOAP,只是使用 Python 标准库同步请求(多线程)。
My application is a desktop client and a web API application. I am writing both programs.
Does the internet discard old requests? Does it make a difference if it is just an old request or a duplicate request?
Is retrying HTTP requests the only way to ensure almost complete end-to-end reliability over HTTP or is there someway to achieve SOAP-level reliability by just setting arguments or headers without using SOAP? My app is not using SOAP, just Python standard library synchronous requests (multi-threaded).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
HTTP 通常不是最理想的选择。您发送一个请求后连接就会断开。
话又说回来,HTTP 使用 TCP。 TCP 将允许您等待响应,该响应将告诉您服务器是否已收到所有信息,而 UDP 则为 Fire & UDP。忘记。
所以TCP层是足够安全的。 HTTP 是一种请求/响应协议。响应后,连接关闭。有一些“保持活动”连接的功能,但这些功能并不适用于所有服务器。你通常不能依赖它。
HTTP 是否是正确的协议取决于具体情况:
如果
,然后
HTTP 是正确的方法。如果上述任何陈述不正确,您最好使用不同类型的 TCP 协议。
HTTP is usually not the most ideal option for this. You send a single request after which the connection is broken.
Then again, HTTP uses TCP. TCP will allow you to wait for a response that will tell you if the server has received all information as opposed to UDP which is fire & forget.
So the TCP layer is secure enough. HTTP is a request/response protocol. After the response, the connection is closed. There are features for 'keep-alive' connections, but these don't work on all servers. You typically can't rely on that.
If HTTP is the right protocol depends on the situation:
If
then
HTTP is the right way to go. If any of the statements above are false, you might better use a different type of TCP protocol.