1

At this point, I'm just trying to get a response from the website. Here's my code:

private void GetFeed(string userName, string password, string url)
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
    request.PreAuthenticate = true;
    request.Timeout = 1000;

    NetworkCredential netCred = new NetworkCredential(userName, password);
    request.Credentials = netCred;

    try
    {
        WebResponse wr = request.GetResponse();
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

My username and password are definitely correct, I've quadruple checked it, so it has to be something to do with how I'm connecting. I think my code is pretty straightforward, but let me know if I need to explain anything.

svick
  • 236,525
  • 50
  • 385
  • 514
Davenport
  • 219
  • 3
  • 9

1 Answers1

0

Download and become familiar with a tool like Fiddler to see how to post exactly what your browser posts to the website. It could be that the site is expecting certain cookies or other headers.

See HttpWebRequest POST data

Community
  • 1
  • 1
Seth Flowers
  • 8,990
  • 2
  • 29
  • 42