HttpWebResponse オブジェクトを取得したら、応答ヘッダーにアクセスする方法が 2 つあります。
string dateHeader = webResponse.Headers["Date"];
string dateHeader = webResponse.GetResponseHeader("Date");
どちらも同じ値を返すのに、ヘッダー情報を取得する方法が 2 つあるのはなぜでしょうか? .NET ソースを見ると、HttpWebReponse で両方の実装が見つかった場合:
    // retreives response header object 
    /// <devdoc>
    ///    <para> 
    ///       Gets 
    ///       the headers associated with this response from the server.
    ///    </para> 
    /// </devdoc>
    public override WebHeaderCollection Headers {
        get {
            CheckDisposed(); 
            return m_HttpResponseHeaders;
        } 
    } 
    /// <devdoc>
    ///    <para> 
    ///       Gets a specified header value returned with the response.
    ///    </para> 
    /// </devdoc> 
    public string GetResponseHeader( string headerName ) {
        CheckDisposed(); 
        string headerValue = m_HttpResponseHeaders[headerName];
        return ( (headerValue==null) ? String.Empty : headerValue ); 
    }
私が見ることができる唯一のことは、Headers プロパティを使用して、利用可能なすべてのヘッダーを列挙できることです。何か案は?
ありがとう!