I'm trying to convert a piece of Objective-C code into C# for use with Monotouch and I have no idea what to use to replace stringWithContentsOfUrl
Should I use something like:
HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://www.helephant.com");
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK &&
response.ContentLength > 0){
TextReader reader = new StreamReader(response.GetResponseStream());
string text = reader.ReadToEnd();
Console.Write(text);
}
Is that even safe to use in MonoTouch? Will it work for the iPhone?