• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTP help

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what do you mean by HTTP is a stateless protocol
 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stateless means no memory.
In a protocol, with state, the whole conversation is remembered. Kind of like this thread. How people post to this thread depends on not just the last message sent, but every message sent previously. We "remember" the entire conversation, or some part of it.
With stateless, that's not the case. It doesn't matter what was done before. Ith HTTP, there are a couple operations, such as GET, POST, GET-HEADERS (I forget the rigt term for this), etc. When you post a get, it doesn't matter whether the previous 1, 10, 100, 1000, etc posts were GETs, POSTs, GET-HEADERs, or some combination of them. It doesn't effect the operation.
More formally. Given a system SYS and operations on the system foo(), and values a..z, we have
Stateful system:
BEGIN
SYS.foo(a) --> w
SYS.foo(c) --> z
END
and
BEGIN
SYS.foo(b) --> y
SYS.foo(c) --> x
END
Note that SYS.foo(c) retrns different values depending on the previous requests. In fact, you can even get:
BEGIN
SYS.foo(d) --> q
SYS.foo(d) --> m
SYS.foo(d) --> x
...
Whereas in a stateless system:
BEGIN
SYS.foo(a) --> w
SYS.foo(c) --> z
END
and
BEGIN
SYS.foo(b) --> y
SYS.foo(c) --> z
END
and in general
BEGIN
SYS.foo(c) --> z
SYS.foo(c) --> z
...
SYS.foo(<any input>) --> <some output>
...
SYS.foo(c) --> z

--Mark
hershey@vaultus.com
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic