Re: #300: Define non-final responses

 On Sun, 17 Jul 2011 22:59:39 +0000, Poul-Henning Kamp wrote:
> In message
> <jio627t392ai6p0nod1702u88ejhvlgvuj@hive.bjoern.hoehrmann.de>, Bjoer
> n Hoehrmann writes:
>>* Poul-Henning Kamp wrote:
>>>There is absolutely no support in the text for the notion that
>>>the server should send a 200 reponse between the 101 and the
>>>switch of protocol.
>>
>>My impression is that the issue is whether you can have a HTTP
>>request that goes unanswered and then have meaningful exchanges
>>on the same connection. Is HTTP a "request-response" protocol, or
>>a "request and then either response or protocol switch" protocol?
>
> The 101 _is_ your HTTP reponse, but it is not the reponse to
> your request.
>
> The reason for this little dance is to avoid an extra round-trip:
>
> Instead of:
>  > GET / HTTP/1.1
>  > Upgrade: Wiz-Bang
>
>  < HTTP/1.1 101 Protocol switch
>  < Upgrade: Wiz-Bang
>
>  > [wiz-bang GET /]
>  < [wiz-bang index.html]
>
> We can:
>  > GET / HTTP/1.1
>  > Upgrade: Wiz-Bang
>
>  < HTTP/1.1 101 Protocol switch
>  < Upgrade: Wiz-Bang
>
>  < [wiz-bang OK index.html]
>

 Or we can do this safely:

   > GET / HTTP/1.1
   > Upgrade: Wiz-Bang
   > Content-Length: NNN
   > Connection: keep-alive
   >
   > [wiz-bang GET /]

   < HTTP/1.1 101 Protocol switch
   < Upgrade: Wiz-Bang
   < Connection: keep-alive
   <
   < [wiz-bang index.html]


 or we can even do this safely:

   > GET / HTTP/1.1
   > Upgrade: Wiz-Bang
   > Content-Length: NNN
   > Connection: keep-alive
   >
   > [wiz-bang GET /]

   < HTTP/1.1 400 Oops.
   > Content-Length: 0
   < Connection: keep-alive
   <

   > GET /next HTTP/1.1


 Now, tell me how that 101 is not final?

 AYJ

Received on Monday, 18 July 2011 00:13:01 UTC