Skip to content

Instantly share code, notes, and snippets.

@jonezy
Created August 6, 2015 18:43
Show Gist options
  • Save jonezy/c1d3b6d7c3d1415486f7 to your computer and use it in GitHub Desktop.
Save jonezy/c1d3b6d7c3d1415486f7 to your computer and use it in GitHub Desktop.
webrequest without 403
HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://www.the416.net/416/?format=rss");
request.UserAgent = "My Test Application";
using(var response = request.GetResponse()) {
using(var dataStream = response.GetResponseStream()) {
using(var reader = new StreamReader(dataStream)) {
var data = reader.ReadToEnd();
Console.Write(data) ;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment