.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Return HTTP Header

Posted By:Sasi Prabhu       Posted Date: July 30, 2011    Points: 40    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

Display the HTTP Header.

public Dictionary GetHTTPResponseHeaders(string Url)


    Dictionary HeaderList = new Dictionary();
    WebRequest WebRequestObject = HttpWebRequest.Create(Url);

    WebResponse ResponseObject = WebRequestObject.GetResponse();
    foreach (string HeaderKey in ResponseObject.Headers)
        HeaderList.Add(HeaderKey, ResponseObject.Headers[HeaderKey]);
    return HeaderList;



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend