You can access a HTTP server using the URL class.

     String webaddress =
"htttp://127.0.0.1:8080/servlet/MyServlet?name=value&anothername=anothervalue";

     InputStream is = null;
     try {
          is = new URL(webaddress).openStream();
     }   catch(Exception e) {
          System.err.println("Unable to create InputStream instance");
                     return;
     }


          BufferedReader br = new BufferedReader(new InputStreamReader(is));
     try {
                    System.out.println("Web Server returned...");
                    String nextLine;
                    nextLine = br.readLine();
                    while (nextLine != null)
                    {
                         System.out.println(nextLine);
                              nextLine=br.readLine();
                    }
     }
          catch(Exception e) {
                    System.err.println("Unable to read from InputStream
instance");
                    return;
          }

          try {
                    if (is != null)
                         is.close();
           }
          catch(Exception e) {
                    System.err.println("Unable to close InputStream instance");
          }

But then that is not using the POST method is it :)

Regards

Neil

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to