Discussion Locked

Using the HttpURLConnection class

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi!! I am a 20 year old, studying Computer Science. We have been given an assignment to write a Java program that does the following:

Displays information about a file URL like tis type, encoding, length, dates of creation, last modification and expiry. Also, the request method, response message and response code for a Web URL are to be displayed.

We have managed to solve the first part of this question. But the latter half still remains to be done. Please help!!!

3 replies

by jay eckles

The method is available from HttpURLConnection.method, the response message from HttpURLConnection.responseMessage, and the response code from HttpURLConnection.responseCode. method and responseMessage are Strings, and responseCode is an int.

What's the trouble? See the documentation for HttpURLConnection at http://java.sun.com/j2se/1.4/docs/api/index.html in the java.net package.

Good luck.

Jay Eckles

by giggles

Sorry for the late response.......but the answer helped me quite a bit. Thanks!!

This discussion is closed to new replies.