[2855] in java-interest

home help back first fref pref prev next nref lref last post

URLConnection questions

daemon@ATHENA.MIT.EDU (Anselm.BairdSmith)
Wed Oct 18 07:55:17 1995

Date: Wed, 18 Oct 1995 10:59:06 +0100
From: "Anselm.BairdSmith" <Anselm.Baird_Smith@inria.fr>
To: java-interest@java.sun.com


Hi,

I am trying to use the URLConnection, and I am having a problem. As I
am not sure of how to use the package, here is what I do:

a) Create an URL from the String url,
b) Open the connection (conn), through URL openConnection()
c) Set some header fields, by using URLConnection setIfModifiedSince()
d) Get the input stream with URLConnection getInputStream().

All this seems to work find, but in this example I am interested by
the reply status code (e.g. NOT_MODIFIED), rather than by the document
content. 

- How do I get the status code ?
- How do I specify a specific method to be applied to the URL (e.g. HEAD) ?  

Anselm.
[BTW I have tried to look at the source, but it seems that most of the
"real" part are implemented in sun.*]

Anselm.BairdSmith@inria.fr - http://www.inria.fr/koala/abaird.html


-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post