title: HTTP POST request. Response expects User Interaction to Proceed.
body: <p>I am quite new to the area where a http request doesn't give a success/error response in the first call. </p>
  
  <p>So, I have a http POST request which hits a URL and then there are series of user interaction. Like, filling a text box for password, clicking on submit and then the next page asks to click on OK or, Cancel to proceed. Once we press OK, the actual end response is shown.</p>
  
  <p>Snippet of the HTML response to my http post request</p>
  
  <pre><code>function listenClose() {
    promptClose = true;
  }
  
  function dontclose() {
    if (promptClose) {
      event.returnValue = "Your purchase has not completed! \nTo complete your purchase click 'Cancel'.";
    }
  }
  
  function exitPrompt() {
    if (submitting == false) {
      ignoreClose();
      input_box = confirm("Are you sure you want to exit? \nYour purchase has not completed! \nClick Cancel to return to . \nClick OK to continue the transaction without .");
      if (input_box == true) {
        exit();
      }
    }
  }
  
  function exit() {
    document.form.cancel.value = "y";
    submitForm();
  }
  
  function onSubmit() {
    ignoreClose();
    submitForm();
    return false;
  }
  
  function submitForm() {
    if (submitting == false) {
      ignoreClose();
  </code></pre>
  
  <p>Question - I can use an HTML form and pass over a browser and go end to end. However the question is how do I simulate the same through Java code? I definitely can send the first request string to the end point through http post. How do I respond to the alerts or, pop ups or, fill in data in the web page through standalone java code?</p>