I'm trying to get Http headers of a PDF viewer page, for can get the pdf file and read it. I'm using the following lines of code:
using (WebClient client = new WebClient()){
client.OpenRead(driver.Url);
string header_contentDisposition = client.ResponseHeaders["content-disposition"];
string filename = new ContentDisposition(header_contentDisposition).FileName;
}
But the server is not finding the source, I'm trying this too:
var disposition= System.Web.HttpContext.Current.Request.Headers["Content-Disposition"];
But Current is null. Any advises or links for understand better http headers, please. Thanks in advance.