Re: [twsocket] Http Get or Post
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
[twsocket] HttpCli and POSTDATA
I have been using fat URLs to retrieve a few web search page results, but for one site I need to use POSTDATA in the request header. How do I set my POSTDATA string before a THttpCli.GetAsync? Thanks, -Johnnie Norsworthy -- 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
Re: [twsocket] HttpCli and POSTDATA
Not sure if this helps you.. but if you use Firefox, there is an extension called LiveHTTPHeaders. It shows you the sequence of communication between the browser and the server. It will help you analyze what is sent to and fro and in what sequence. Hope this helps. Cheers Mohit. Johnnie Norsworthy wrote: I have been using fat URLs to retrieve a few web search page results, but for one site I need to use POSTDATA in the request header. How do I set my POSTDATA string before a THttpCli.GetAsync? Thanks, -Johnnie Norsworthy -- 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
Re: [twsocket] HttpCli and POSTDATA
Hello, POSTDATA is not included in the header but like this: POST / HTTP/1.1 Host: www.overbyte.be empty line, end of header username=userpassword=pwd (POSTDATA HERE--just like content in GET) Regards, SZ - Original Message - From: Johnnie Norsworthy [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Monday, September 25, 2006 3:51 AM Subject: Re: [twsocket] HttpCli and POSTDATA : Thanks; I know the header format, I just need to know how to apply the : POSTDATA string to the header before getting the page. : : I used a FireFox extension to get the POSTDATA format. : -- : 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 -- 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
Re: [twsocket] HttpCli and POSTDATA
POSTDATA is not included in the header but like this: POST / HTTP/1.1 Host: www.overbyte.be empty line, end of header username=userpassword=pwd (POSTDATA HERE--just like content in GET) Thanks SZ, but how do I add that to a THttpCli before calling .GetAsync? Is there an example in the ICS samples? -Johnnie -- 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
Re: [twsocket] HttpCli and POSTDATA
Johnnie Norsworthy wrote: POSTDATA is not included in the header but like this: POST / HTTP/1.1 Host: www.overbyte.be empty line, end of header username=userpassword=pwd (POSTDATA HERE--just like content in GET) Thanks SZ, but how do I add that to a THttpCli before calling .GetAsync? Is there an example in the ICS samples? -Johnnie I apologize that I have not followed this thread completely, but if you plan to use POST, should you not be using .PostAsync? Cheers Mohit. -- 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