How can I programmatically determine if a binary on a website (like an image) has changed without uploading it?

How can I programmatically determine if a binary on a website (such as an image) has changed without downloading it? Is there a way using HTTP methods (in this case C #) to check it before it fully loads?

+5
source share
3 answers

You can check if the file has changed or not by querying with HEAD .

Then, the response response header may include Last-Modified or ETag , if web server support.

+6
source

, Last-Modified HEAD ( GET). , HEAD WebClient .

+9

You can execute the HEAD query and check the last datetime value as well as the length of the content.

+5
source

All Articles