Get only response headers

Possible duplicate:
HttpWebResponse: close the stream

With ASP.NET, can I make a request and get only response headers? I have to make a request to a large file, but I only need the response headers, I do not care about the contents of the file.

I would like to know if there is something similar to get_headers from php ( http://php.net/manual/en/function.get-headers.php ).

+3
source share
1 answer

I'm not sure how to do this initially, but at least you can use your own HTTP handler ( ASHX ) to create the necessary headers and do not return anything in response.

Update:

WebRequest.Method = "HEAD", . W3.

+4

Source: https://habr.com/ru/post/1772318/


All Articles