public GetResponseHeader ( string headerName ) : string | ||
headerName | string | |
return | string |
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://example.com"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string contentType = response.GetResponseHeader("Content-Type");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://example.com"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string redirectLocation = response.GetResponseHeader("Location");Package Library: System.Net.HttpWebRequest (part of .NET Framework)