Return-Path: Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@www.apache.org Received: (qmail 29787 invoked from network); 24 Feb 2004 08:50:53 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Feb 2004 08:50:53 -0000 Received: (qmail 31498 invoked by uid 500); 24 Feb 2004 08:50:28 -0000 Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@jakarta.apache.org Received: (qmail 31479 invoked by uid 500); 24 Feb 2004 08:50:28 -0000 Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Commons HttpClient Project" Reply-To: "Commons HttpClient Project" Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 31465 invoked from network); 24 Feb 2004 08:50:27 -0000 Received: from unknown (HELO dedi58.your-server.de) (213.133.106.58) by daedalus.apache.org with SMTP; 24 Feb 2004 08:50:27 -0000 Received: (qmail 7703 invoked from network); 24 Feb 2004 08:50:38 -0000 Received: from clt.clt-st.de (HELO buddha.clt.intranet) (212.18.198.186) by dedi58.your-server.de with SMTP; 24 Feb 2004 08:50:38 -0000 Received: from clt-st.de (buddha.clt.intranet [127.0.0.1]) by buddha.clt.intranet (8.12.8/8.12.8) with ESMTP id i1O8oXdk022822 for ; Tue, 24 Feb 2004 09:50:33 +0100 Message-ID: <403B1059.50204@clt-st.de> Date: Tue, 24 Feb 2004 09:50:33 +0100 From: Diana Steffen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030303 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Commons HttpClient Project Subject: Re: two post requests References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Roland, and thank you for the detailed answer. It helped. It's the "hard case" I have to deal with, but this is ok. I missed some understanding about how these forms work, now everything is clear. Thank you again, Diana > Hello Diana, > > there are some possible cases... you'll have to analyse the > page returned as the response to the first POST request. > > Easy case: The second POST request is just a generic request > with fixed data, such as parameter "confirm" set to "true". You > extend your program to send that fixed second POST request > after the first one. > > Tricky case: The second POST request contains the parameters > from the first POST request. If your program remembers them, > you can extend it to send the second POST request after the > first one. If you're lucky, you may even detect some indicator > parameter (confirm->true or so) that is the only difference between > the first and second POST. Which means you could forget about > the first POST and send the second first... eh... you know what > I mean, don't you? > > Hard case: The second POST request contains dynamic data, > such as a random number, session ID or something. Then you'll > need an HTML parser to get the data out of the HTML page so > you can send the second POST request. HTML parsing is out > of the scope of HttpClient. See the mailing list archive for links > to HTML parsers. > > hope that helps, > Roland > > > > > > > Diana Steffen > 23.02.2004 18:02 > Please respond to "Commons HttpClient Project" > > To: Commons HttpClient Project > > cc: > Subject: two post requests > > > Hello, > > I'm new in using HttpClient and I have the following problem: > > There is an external web application using a post form. > When the user provides the values for the form fields, he receives > a new post form, under the same URL. Here he must push a submit button, > to confirm that the values he just provided are correct. > > Now I'm trying to do all this using HttpClient. My application > makes the first post request and gets the second post form as result > (getResponseBody()). Unfortunately I don't know how to make the > second post request. > > Can you give me a hint? > > Thank you. > Diana > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > commons-httpclient-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > commons-httpclient-dev-help@jakarta.apache.org > > > -- Diana Steffen Softwareentwicklung CLT Sprachtechnologie GmbH tel: 0681-3096-532 fax: 0681-3096-555 www: http://www.clt-st.de/index.html --------------------------------------------------------------------- To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org