Click here to Skip to main content
15,896,915 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Can you help me log in to an HTTPS page and navigate about the site. For example, can you help me log in to Yahoo or Google or MSDN or anything HTTPS, get the necessary cookies, request another page, and get a response that tells me the server has me as logged in. I have done a lot of reading about this but I need some real code and a decent working simple example to get me started. I have done a lot of googling so no link posting please. If you can provide me with one line of code that is better than a link.

I have used web requests and web responses to make a basic web scraper. So I can do basic getting a page. What I seem to be having trouble with are at least these three issues PLUS the general concept:
1. using POST
2. storing/sending cookies
3. knowing which requests and responses need to be sent.

How the webrequest/webresponse classes work in C# and exactly how much of the back and forth communication I need to be responsible for. For example, if I get a redirect or something do I need to handle that or is it handled automatically for me?

*I have fiddler installed so I can see HTTP I/O on this computer. One thing that I am amazed and intimated by is the volume of HTTP communication that goes on when doing even the most trivial tasks like visiting Yahoo.
Posted
Updated 2-Feb-11 17:52pm
v3
Comments
Henry Minute 3-Feb-11 20:43pm    
You haven't said what sort of application this is. It might help you to get answers if you edit your tags to say if this is ASP.NET Widows Forms or what. :)
seanmchughinfo 12-Feb-11 19:10pm    
It's a C# console or windows forms application. It is not ASP.NET.

no answers yet?

Can anyone provide any information at all? It doesn't have to be a complete comprehensive tutorial. Any help is appreciated.
 
Share this answer
 
First, be patient!
you might want to check out the msdn forum at : http://msdn.microsoft.com/en-us/library/aa752085(v=vs.85).aspx[^]
 
Share this answer
 
Comments
seanmchughinfo 3-Feb-11 21:22pm    
okay, sorry. This is actually the first question I have posted on here so I'm not sure how long it takes to get an answer.

I have the same question posted on MSDN.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900