Accessing HTTP URL MIME Header
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mazhar_Patel
Posted On:   Thursday, May 16, 2002 10:08 AM

I have built an application which downloads given URL page and search the page for some new contents. To minimize the process and data transfer rate ,i used MIME header of given URL ,in which I checked for Last-Modified Date and Content Length fields and if there is any changes then only application downloads it. I have used HttpURLConnection ,in which I used setRequestMethod("HEAD") to get MIME Header of URL ,but the problems is not each URL return Content-Length or Last-ModifiedDate in their MIME Header ,so Is their any method through which I could get solve thid problem . I want each MIME header should have Content-Length and Last-ModifiedDate field ,so that I could optimize my application process .    More>>

			
I have built an application which downloads given URL page and search the page for some new contents.

To minimize the process and data transfer rate ,i used MIME header of given URL ,in which I checked for Last-Modified Date and Content Length fields and if there is any changes then only application downloads it.

I have used HttpURLConnection ,in which I used setRequestMethod("HEAD") to get MIME Header of URL ,but the problems is not each URL return Content-Length or Last-ModifiedDate in their MIME Header ,so Is their any method through which I could get solve thid problem .
I want each MIME header should have Content-Length and Last-ModifiedDate field ,so that I could optimize my application process .

thanks
Mazhar Patel

   <<Less

Re: Accessing HTTP URL MIME Header

Posted By:   Jorgen_Nordqvist  
Posted On:   Sunday, May 19, 2002 07:34 PM

Mazhar,

The headers you mentioned are not mandatory and you will find a lot of dynamically generated pages that do not have these headers set.

One way to detect a changed page would be to calculate some kind of checksum over a page and then comparing that checksum to the checksum of a future page. However, this is not fool proof either as you need to exclude dynamic text like date and times from the checksum calculations.

Jorgen

About | Sitemap | Contact