R
rajkiranpro
I tried to create an object of xmlhttpclass.
MSXML2.XMLHTTPClass xmlclass = new MSXML2.XMLHTTPClass();
xmlclass.open("POST", txtURL.Text, false, null, null);
xmlclass.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
xmlclass.send(txtRequest.Text);
System.IO.StreamReader sr = new
System.IO.StreamReader((System.IO.Stream)xmlclass.responseStream);
txtREsponse.Text = sr.ReadToEnd();
sr.Close();
however I couldn't get the response stream. I get the following error while
doing so
Unable to cast COM object of type 'System.__ComObject' to class type
'System.IO.Stream'. Instances of types that represent COM components cannot
be cast to types that do not represent COM components; however they can be
cast to interfaces as long as the underlying COM component supports
QueryInterface calls for the IID of the interface.
Please help me
Regards
Rajkiran
MSXML2.XMLHTTPClass xmlclass = new MSXML2.XMLHTTPClass();
xmlclass.open("POST", txtURL.Text, false, null, null);
xmlclass.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
xmlclass.send(txtRequest.Text);
System.IO.StreamReader sr = new
System.IO.StreamReader((System.IO.Stream)xmlclass.responseStream);
txtREsponse.Text = sr.ReadToEnd();
sr.Close();
however I couldn't get the response stream. I get the following error while
doing so
Unable to cast COM object of type 'System.__ComObject' to class type
'System.IO.Stream'. Instances of types that represent COM components cannot
be cast to types that do not represent COM components; however they can be
cast to interfaces as long as the underlying COM component supports
QueryInterface calls for the IID of the interface.
Please help me
Regards
Rajkiran