C
Chris Berg
I would like to upload a file to a HTTP server using the PUT method. I
know it is unusual, and not many programmers use this method these
days, byt in my particular case it would be better and faster than
POST. It is supported by most servers (including IIS), but my question
is, how do I write the client?
There is one interesting detail here: Normally, one could get finer
access to the protocol by doing:
HttpUrlConnection huc= (HttpUrlConnection) myUrl.getConnection();
as HttpUrlConnection has extra methods, possibly useful for this sort
of thing. But that will fail if you run it on MS's 1.1-VM (IE),
because the class returned is NOT a subclass of HttpUrlConnection.
This prevents me from doing
huc.setRequestMethod("GET");
Has anyone ever tried this? I can't find any useful info on "GET" on
the web.
Chris
know it is unusual, and not many programmers use this method these
days, byt in my particular case it would be better and faster than
POST. It is supported by most servers (including IIS), but my question
is, how do I write the client?
There is one interesting detail here: Normally, one could get finer
access to the protocol by doing:
HttpUrlConnection huc= (HttpUrlConnection) myUrl.getConnection();
as HttpUrlConnection has extra methods, possibly useful for this sort
of thing. But that will fail if you run it on MS's 1.1-VM (IE),
because the class returned is NOT a subclass of HttpUrlConnection.
This prevents me from doing
huc.setRequestMethod("GET");
Has anyone ever tried this? I can't find any useful info on "GET" on
the web.
Chris