C# WebRequest Forbidden

585 views Asked by At

using the URL http://myanimelist.net/malappinfo.php?u=fakemudkipper&status=all&type=anime And using the code

WebRequest req = WebRequest.Create("http://myanimelist.net/malappinfo.php?u=" + username + "&status=all&type=anime");
WebResponse responce = req.GetResponse();

This code used to work, but suddenly it no longer works, and returns the error The remote server returned an error: (403) Forbidden. It does load on my web browser. I have also tried to use

req.Credentials= new NetworkCredential("username", "password");

But this did not help

1

There are 1 answers

2
Dean On

I suggest looking into Webclient

http://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.110).aspx

From there you could download the website easier, instead of using webrequests(which already proved bad).