It has nothing to do with ASP.NET. You need to use the class
System.Net.HttpWebRequest
, but to obtain its instance you need to use the class
System.Net.WebRequest
and its method
Create
, as the run-time type is defined by the URI.
See:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx[
^].
Find a code sample for login here:
http://stackoverflow.com/questions/450380/login-to-the-page-with-httpwebrequest[
^]; HTTPS protocol is used the same way, the code is the same but the root certificate should be registered on the system, see
certmgr.msc
.
See also:
http://en.wikipedia.org/wiki/Public_key_certificate[
^],
http://en.wikipedia.org/wiki/Certificate_authority[
^],
http://en.wikipedia.org/wiki/Self-signed_certificate[
^] and links from these articles.
Now, parsing of the response…
The ideal case would be if the response provided well-formed XML, which is well supported by .NET parsers. If this is not the case, you can find some HTML parser which does not assume well-formed XML. Try this one:
http://www.majestic12.co.uk/projects/html_parser.php[
^], Google for some more.
—SA