none
HttpWebRequest GetResponse throws ArgumentNullException RRS feed

  • Question

  • Hi,

    I have a problem in a piece of code which I use since a long time: The following line

    httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();

    throws an ArgumentNullException for the parameter value when trying to access "https://www.flickr.com".
    In the call stack window I see the following:

    mscorlib.dll!System.Enum.TryParseEnum(System.Type enumType, string value, bool ignoreCase, ref System.Enum.EnumResult parseResult)
    mscorlib.dll!System.Enum.Parse(System.Type enumType, string value, bool ignoreCase)
    System.dll!System.Net.ServicePointManager.EnsureStrongCryptoSettingsInitialized()
    System.dll!System.Net.ServicePointManager.SecurityProtocol.get()
    System.dll!System.Net.TlsStream.ProcessAuthentication(System.Net.LazyAsyncResult result)
    System.dll!System.Net.TlsStream.Write(byte[] buffer, int offset, int size)
    System.dll!System.Net.ConnectStream.WriteHeaders(bool async)
    System.dll!System.Net.HttpWebRequest.EndSubmitRequest()
    System.dll!System.Net.Connection.CompleteConnection(bool async, System.Net.HttpWebRequest request)
    System.dll!System.Net.Connection.CompleteStartConnection(bool async, System.Net.HttpWebRequest httpWebRequest)
    System.dll!System.Net.Connection.CompleteStartRequest(bool onSubmitThread, System.Net.HttpWebRequest request, System.Net.TriState needReConnect)
    System.dll!System.Net.Connection.SubmitRequest(System.Net.HttpWebRequest request, bool forcedsubmit)
    System.dll!System.Net.ServicePoint.SubmitRequest(System.Net.HttpWebRequest request, string connName)
    System.dll!System.Net.HttpWebRequest.SubmitRequest(System.Net.ServicePoint servicePoint)
    System.dll!System.Net.HttpWebRequest.GetResponse()
    HttpClientLibrary.dll!HttpClientLibrary.HttpClient.GetWebResponse(string link, System.Net.HttpWebRequest httpWebRequest) Line 547

    The network trace looks like:

    System.Net Information: 0 : [9680] Der aktuelle Betriebssysteminstallationstyp ist "Client".
    System.Net Verbose: 0 : [9680] WebRequest::Create(https://www.flickr.com/)
    System.Net Verbose: 0 : [9680] HttpWebRequest#33111870::HttpWebRequest(https://www.flickr.com/#114336723)
    System.Net Information: 0 : [9680] RAS unterstützt: True
    System.Net Verbose: 0 : [9680] Exiting HttpWebRequest#33111870::HttpWebRequest()
    System.Net Verbose: 0 : [9680] Exiting WebRequest::Create()  -> HttpWebRequest#33111870
    System.Net Error: 0 : [9680] Die Proxyeinstellungen für URI "https://www.flickr.com/" können nicht abgerufen werden. Fehlercode: 12180.
    System.Net Verbose: 0 : [9680] ServicePoint#27806816::ServicePoint(www.flickr.com:443)
    System.Net Information: 0 : [9680] Associating HttpWebRequest#33111870 with ServicePoint#27806816
    System.Net Information: 0 : [9680] Associating HttpWebRequest#33111870 with ServicePoint#27806816
    System.Net Verbose: 0 : [9680] HttpWebRequest#33111870::GetResponse()
    System.Net Information: 0 : [9680] Associating Connection#66337667 with HttpWebRequest#33111870
    System.Net.Sockets Verbose: 0 : [9680] Socket#35489797::Socket(AddressFamily#2)
    System.Net.Sockets Verbose: 0 : [9680] Exiting Socket#35489797::Socket()
    System.Net.Sockets Verbose: 0 : [9680] Socket#45795543::Socket(AddressFamily#23)
    System.Net.Sockets Verbose: 0 : [9680] Exiting Socket#45795543::Socket()
    System.Net.Sockets Verbose: 0 : [9680] DNS::TryInternalResolve(www.flickr.com)
    System.Net.Sockets Verbose: 0 : [9680] Socket#35489797::Connect(188.125.93.38:443#643660807)
    System.Net.Sockets Information: 0 : [9680] Socket#35489797 - Die Verbindung von 192.168.0.10:55268 mit 188.125.93.38:443 wurde hergestellt.
    System.Net.Sockets Verbose: 0 : [9680] Exiting Socket#35489797::Connect()
    System.Net.Sockets Verbose: 0 : [9680] Socket#45795543::Close()
    System.Net.Sockets Verbose: 0 : [9680] Socket#45795543::Dispose()
    System.Net.Sockets Verbose: 0 : [9680] Exiting Socket#45795543::Close()
    System.Net Information: 0 : [9680] Connection#66337667 - Die Verbindung von 192.168.0.10:55268 mit 188.125.93.38:443 wurde hergestellt.
    System.Net Information: 0 : [9680] TlsStream#65677972::.ctor(host=www.flickr.com, #certs=0)
    System.Net Information: 0 : [9680] Associating HttpWebRequest#33111870 with ConnectStream#8442299
    System.Net Information: 0 : [9680] HttpWebRequest#33111870 - Request: GET / HTTP/1.1

    System.Net Information: 0 : [9680] ConnectStream#8442299 - Header
    {
    User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
    Host: www.flickr.com
    Accept-Encoding: gzip, deflate
    Connection: Close
    } werden gesendet.

    Any help on solving this problem is truly appreciated!

    Kind regards,
    Alexander

    Friday, July 24, 2015 8:13 AM

Answers