On Sep 23, 2006, at 08:32, Paul wrote:
> Hi,
>
> What is the best method when I send a stream to a server, but expect a
> stream back from the server with the same request ?
It may sound silly, but think about the names of the methods to
understand their original intention:
GET - To request a resource from the server ("get" a document).
POST - To submit data to the server, and possibly (but not necessarily)
receive a response based on that data ("post" customer info).
Responses in POST may contain just data (it doesn't really need to be
an html page), and are returned in the body of the response.
The guidelines are that anything that requires a server-side state or
data change should be implemented via POST, and anything that just
seeks a resource from the server without requiring server alterations
may be implemented via GET.
Do not pay attention to comments that say "POST is better than GET",
because this is not true: it depends on what you want to do. Both
accommodate for a large number of data to be sent. In the case of
POST, it is intended to be _DATA_ that will affect the server state
somehow (store to db, add or remove from global state, etc.); while in
the case of GET, it is intended to be variables to help the server
determine which resource to return (page number, file id, etc.)
> It's the most logical method for sending data, but I need to receive a
> stream back with the same request.
What do you mean you need to receive the same request back? Do you
mean that the server needs to return the same data sent with the
request? In that case, you should use POST: the data will be posted in
the body of the request, and the response should be returned in the
body again.
I hope this helps.
dZ.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be