My applet tries an HTTP post, but on mac this results in an HTTP GET?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Erwin_Beckers
Posted On:   Tuesday, August 26, 2003 01:17 AM

Hi, I'm writing a simple applet which does an HTTP post to the server. This works perfectly under windows (on netscape 7+,IE5+, mozilla 1.4+) But on my macos 9 with netscape 7 and mrj 2.2.5 it fails. Instead of an HTTP POST it does an HTTP GET and NO data is send @ all I tried both URLConnection & HTTP connection and still it fails. Please help!!!! Here's my piece of code: url = new URL(getCodeBase(),"SavePage.asp"); HttpURLConnection conn =(HttpURLConnection)url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput( true ); conn.setDoInput( true ); conn.setUseCaches(false); conn.setRequestProperty("   More>>

Hi,
I'm writing a simple applet which does an HTTP post to the server. This works perfectly under windows (on netscape 7+,IE5+, mozilla 1.4+)
But on my macos 9 with netscape 7 and mrj 2.2.5 it fails.
Instead of an HTTP POST it does an HTTP GET and NO data is send @ all
I tried both URLConnection & HTTP connection and still it fails. Please help!!!!
Here's my piece of code:


			

url = new URL(getCodeBase(),"SavePage.asp");
HttpURLConnection conn =(HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setDoOutput( true );
conn.setDoInput( true );
conn.setUseCaches(false);
conn.setRequestProperty("Content-Type","application/octect-stream");
conn.setRequestProperty("Content-length",String.valueOf(bytes.length));

DataOutputStream outStream = new DataOutputStream(conn.getOutputStream());
outStream.write(bytes);
outStream.flush();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine = null;
while ((inputLine = in.readLine()) != null)
{
}

outStream.close();
in.close();



Erwin    <<Less
About | Sitemap | Contact