1
Vote

(HttpWebRequest)WebRequest.Create(requestUri) Fails W Exception

description

as discussed here:
http://tinyclr.com/forum/2/5537/#/2/msg53395
 
and:
http://www.tinyclr.com/forum/2/5313/
 
 
error:

Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (4)

Message:

GHIElectronics.NETMF.Net.HttpWebResponse::GetResponseHeader [IP: 0008]

GHIElectronics.NETMF.Net.HttpWebResponse::get_ContentType [IP: 0007]

 
    public static void ProcessRequest(string requestUri, int count)
    {
        // var request = (HttpWebRequest)WebRequest.Create(requestUri);
        using (var request = (HttpWebRequest)WebRequest.Create(requestUri))

        {
            request.Method = "GET";
            // send request and receive response

            using (var response = (HttpWebResponse)request.GetResponse())
            {
                Debug.Print("have a response, consuming....");
                // consume response
                HandleResponse(response, count);  // On Panda, this is NULL issues, on Netduino has valid response!
            }

        }
    }
<<<<<<<<<<<<<

comments

SamJones3 wrote Jan 30, 2012 at 6:10 PM

Note that the fix proposed on: http://www.tinyclr.com/forum/2/5565/#/2/msg54257

does not solve the issue I am seeing (I tried it)

wrote Feb 13, 2013 at 6:22 PM