请求-响应对叫什么?
例如,在 HTTP 中,您发送请求并接收响应; 是否有一个名词来描述该请求-响应对?
我想到了“对话”或“对话”,但它们意味着多个请求-响应对,而我正在寻找一个恰好指示一个的单词。
询问的原因是我需要命名一个封装两者细节的对象,而 RequestResponse
似乎相当蹩脚。
For example in HTTP you send a request and receive a response; is there a noun that describes that request-response pair?
I'd thought of "dialog" or "conversation" however those imply multiple request-response pairs, whereas I'm looking for a word that indicates exactly one.
The reason for asking is that I need to name an object which encapsulates the details of both, and RequestResponse
seems fairly lame.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
ServiceConversation
怎么样?What about
ServiceConversation
RequestResponseContext
怎么样?what about
RequestResponseContext
?我会选择
Exchange
或RequestResponse
。我还在代码中将其命名为
Operation
,因为我会对操作进行排队、刷新操作、暂停或恢复操作。I would go for
Exchange
orRequestResponse
.I also went to name it
Operation
in my code as I would queue Operations, flush Operations, pause or resume Operations.说好的“交换”呢?
How about "exchange"?
RequestResponsePair
听起来就像它所说的那样。 我发现这是无价的。RequestResponsePair
sounds like it does exactly what it says. And that's invaluable, I find.相互作用
Interaction
我会使用消息或交易
I'd use Message or Transaction
Transceival 或 ServiceCall 可能有效。
Transceival
orServiceCall
might work.HttpRoundTrip
- 灵感来自 Jeff Atwood 的 这篇博文HttpRoundTrip
- inspired by Jeff Atwood in this blog postFiddler 将其称为会话。
Fiddler calls it a Session.
OpenRasta 使用“通信”来表示请求/响应对。
OpenRasta used "communication" for the request/response couple.
在我的特定情况下,我考虑将其称为
连接
。 当您发送 HTTP 请求时,您基本上是在与某个端点建立连接。我不喜欢它的至少一个原因是,与
Session
类似,人们可以假设当前正在发生一些活动,这可能是真的,也可能不是。背景:我需要记录与第三方服务的所有交互。
PS 恕我直言,
Exchange
是其中最好的。 听起来比较抽象。In my particular case I consider calling it a
Connection
. When you send a HTTP request, you're basically establishing a connection with some endpoint.At least one reason why I dislike it is that similar to
Session
, one can assume there is some activity at the moment happening, which may or may not be true.Background: I need to log all interactions with third-party service.
P.S. IMHO,
Exchange
is the best among others. It sounds more abstract.