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 <[EMAIL PROTECTED]>
23.02.2004 18:02
Please respond to "Commons HttpClient Project"
 
        To:     Commons HttpClient Project 
<[EMAIL PROTECTED]>
        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: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]


Reply via email to