42

There's one thing I haven't found in RFC 2616 ("Hypertext Transfer Protocol -- HTTP/1.1") and that's a "canonical" name for a request/response pair. Is there such thing?

4.1 Message Types:

4.1 Message Types

   HTTP messages consist of requests from client to server and responses
   from server to client.

       HTTP-message   = Request | Response     ; HTTP/1.1 messages

Taking this as a template, which word would you put in the following sentence?

A single complete HTTP ... consists of one HTTP Request and one HTTP Response

    HTTP-... = Request Response

roundtrip? cycle?

Community
  • 1
  • 1
VolkerK
  • 95,432
  • 20
  • 163
  • 226

5 Answers5

43

The spec calls them "exchanges" (or "request/response exchanges").

Per section 1.4, "Overall Operation":

In HTTP/1.0, most implementations used a new connection for each request/response exchange. In HTTP/1.1, a connection may be used for one or more request/response exchanges […]

Community
  • 1
  • 1
Greg
  • 316,276
  • 54
  • 369
  • 333
  • Though I like the term transaction, what I really was looking for was a more "authoritative" reference like ..um, yeah.. the rfc itself. Thanks. – VolkerK Nov 28 '08 at 09:39
  • 1
    I like "transaction" too but I guess maybe that implies some guarantees that aren't there... if the response can't be delivered, then the request won't be rolled back. – Greg Nov 28 '08 at 09:47
  • True again. Then "exchange" it is. – VolkerK Nov 28 '08 at 09:58
  • rollback is kind of database specific. transaction is used in many non-database contexts. but if the rfc says exchange, go with that. – ysth Mar 01 '09 at 06:45
  • Imo, an HTTP transaction could have more than one exchange. If there is a redirection, there would be 2 exchanges, both would be within the same transaction. Just a thought... – Micha Mazaheri Aug 30 '14 at 09:49
  • The analogous section of RFC 2616's replacement, [RFC 7230](https://tools.ietf.org/html/rfc7230#section-2.1), uses the same terminology: "A connection might be used for multiple request/response exchanges, as defined in Section 6.3." – M. Justin Apr 23 '21 at 20:19
9
  • RFC2616 calls it an Exchange.
  • Wireshark and HTTPNetworkSniffer call it a Request/Response.
  • Fiddler calls it a Session.
  • Charles calls it a Sequence.
  • HTTP Scoop calls it a Conversation.
  • Other vocabulary includes: Message, Transaction, Communication.

I would go for Exchange or RequestResponse.

I also went to name it Operation in my code as I would queue Operations, flush Operations, pause or resume Operations.

M. Justin
  • 14,487
  • 7
  • 91
  • 130
Cœur
  • 37,241
  • 25
  • 195
  • 267
1

Exchanges is nice name, also we can use Connection, Communication or session

Ahmad Al-Kurdi
  • 2,248
  • 3
  • 23
  • 39
  • Connection is not a good word to use for Exchanges, since it has another meaning - the underlying channel on which the messages are sent. – diviquery Mar 14 '23 at 04:48
0

Payload

In my project, I needed a name so that I can differentiate between models (Database) and HTTP interaction objects, so I am using payload, like:

  • ProductPayload, ProductModel
  • CartPayload, CartModel
  • OrderPayload, OrderModel
vikas
  • 1
  • 1
-1

Transaction, yes, or "A singe HTTP Request consists of one HTTP Request message and one HTTP Response message."

ysth
  • 96,171
  • 6
  • 121
  • 214