Network Java Tutorial

You can use a URLConnection object to send an HTTP request.

import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
public class MainClass {
  public static void main(String[] a)throws Exception {
    URL url = new URL("http://www.yourdomain.com/form.jsp");
    URLConnection connection = url.openConnection();
    connection.setDoOutput(true);
    PrintWriter out = new PrintWriter(connection.getOutputStream());
    out.println("firstName=Joe");
    out.println("lastName=Average");
    out.close();
  }
}