• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

http fi modified since

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello to all of you
I want you to excuse me for my english but i am greek
I have an application that downloads web sites some times per week
i want to make this application to check if the sites are updated since the last time thay have been downloaded.
Have any of you any idea about how tha HttpURLConnection works with this becouse i am working on this 2 days now but i it seems that i do something wrong.Even some tips about http can help me so i whoulb be pleased if you can support me
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, welcome to the ranch!

HTTP has a IF-MODIFIED-SINCE header. If the resource you request is not newer than the date you give, you should get back a 304 return code for not modified. You should be able to add this header to your HTTPUrlConnection.

From your subject, it sounds like that's what you're trying to use. What do you have that's not working? Feel welcome to post small snippets of code if you have narrowed the problem down. Be sure to look into the "CODE" button while entering your post.

The W3C Site is an thorough (if a bit hard to read) source for HTTP stuff.
[ July 10, 2005: Message edited by: Stan James ]
 
alexandros mouzakidis
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the code that i wrote but it seems that something is wrong becouse it allwase returns response code 200

the value for lartVisitedDate hase been taken previously from a database with correct values
even if i give lastVisitedDate the current time it allways returns 200 witch means that the site is upadated since then
the application used to access dynamic sites is this a broblem;
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try openConnection(), setIfModifiedSince(), Connect(), ifModifiedSince(). Let me know if it's any different.
 
alexandros mouzakidis
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it's still do the same thing
anyway i removed this feature from my application so there is no problem any more.
But if you know what the lastModified() do probably i can do something..
thanks for your time
 
reply
    Bookmark Topic Watch Topic
  • New Topic