Article View: borland.public.jbuilder.java.language
Article #17006HttpURLConnections broken? IE broken?
From: ted19
Date: Sat, 26 Dec 1998 00:00
Date: Sat, 26 Dec 1998 00:00
25 lines
1742 bytes
1742 bytes
This is my understanding of how to POST data on an http connection from Java:
URL url = new URL("http://mario:8001/servlets/HighScoresServlet.class");
URLConnection urlc = url.openConnection();
HttpURLConnection http = (HttpURLConnection) urlc;
http.setDoOutput(true);
http.setMethod("POST");
OutputStream out = http.getOutputStream();
...
In IE, the openConnection() call returns a
com.ms.net.wininet.http.HttpURLConnection
which is ***not a subclass of java.net.HttpURLConnection***!!!
(Thus causing a ClassCastException)
How the heck am I supposed to POST data without access to the
setMethod("POST") method in java.net.HttpURLConnection? Is this an attempt to
get me to write nonportable code? I want to move serialized objects to a
servlet, and POST is the only way. The default GET method is not what I want.
Thanks,
Ted
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<763b99$u11$1@nnrp1.dejanews.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 146a3d,9ef198bdac1f7c22,start X-Google-Attributes: gid146a3d,public X-Google-Thread: f74b3,9ef198bdac1f7c22,start X-Google-Attributes: gidf74b3,public From: ted19@hotmail.com Subject: HttpURLConnections broken? IE broken? Date: 1998/12/26 Message-ID: <763b99$u11$1@nnrp1.dejanews.com> X-Deja-AN: 425957860 X-Http-Proxy: 1.1 x10.dejanews.com:80 (Squid/1.1.22) for client 153.37.7.171 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sat Dec 26 18:52:24 1998 GMT Newsgroups: borland.public.jbuilder.java.language,borland.public.jbuilder.java.applet-issues X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)