I have a CDN with files, and I want to create a small tool that checks for the file existence there, based on a pre-defined files list.
I tried to use WebRequest, but it seems like it to download the file. I just want to get the content length without downloading it. (similar to curl -I )
Thanks
You might be able to make a HEAD request to get that information.
Quote from w3.org:
From what I’ve read elsewhere, the content-length should be present in a HEAD response. But “should” doesn’t necessarily mean it always is (see: Content-Length header with HEAD requests?)