I have a Swing applet (JRE1.3) on Sun & Netscape 4.6 that needs to POST a url to a c++ cgi. The exact same code works for an applet without the plugin but my code does not! I cannot set the METHOD to POST, the recieving cgi extracts the method as GET no matter what I do! (I need POST) Does the plugin have it's own set of environment vars? The code is simple: URL url = new URL("http:..."); URLConnection connection = url.openConnection(); url.setDoOutput(true); //POST OutputStream out = connection.getOutputStream(); ... Thanks!
posted 14 years ago
If your URLConnection is a HttpURLCOnnection you could use connection.setRequestMethod("POST"). /Andreas