In this section, you will learn how to get content-length, content- type, and last-modify date of a file. Here we provide a complete example that uses getHeaderFieldKey() method. Firstly create a class GetHTTPHeader and initialize a class URLConnection. T
Tutorial Details:
In this section, you will learn how to get content-length, content- type, and last-modify date of a file. Here we provide a complete example that uses getHeaderFieldKey() method. Firstly create a class GetHTTPHeader and initialize a class URLConnection. Then we call openConnection() method. After that we use the try and catch block to know whether the code is working correctly or not.
This is the method returns the key for the nth header field. The HTTP server returns the status line. In this case, getHeaderField() method returns the status line, but getHeaderFieldKey() method returns null.
Rate Tutorial: http://www.roseindia.net/java/network/gethttpheader.shtml
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: GetHTTPHeader
View Tutorial: GetHTTPHeader
Related
Tutorials:
|