Hello everyone. I have a problem trying to develop a windows phone app as a university project. Part of it is to use google APIs. So I'm trying to make a test web request.My code is as follows:
string api_request = "https://maps.googleapis.com/maps/api/place/textsearch/xml?query=restaurants+in+Sydney&sensor=true&key=AIzaSyDpXZSLtOeGLJcYwKKJs2yAAEdfLST0ZXs";
HttpWebRequest google_request = (HttpWebRequest)WebRequest.Create(api_request);
HttpWebResponse google_response_file = (HttpWebResponse)google_response.GetResponse();
StreamReader google_response_datastream = new StreamReader(google_response.GetResponseStream());
As you can see I'm creating an HttpWebRequest object and I initialize it. However, when I try to get a response I create an HttpWebResponse object but the initializer method is not accessible. After some googling I find out that insted of the HttpWebResponse initializer I have to use GetResponse() instead. Everywhere I look I find this but the C# compiler keeps considering the GetResponse method non-existent (and it is). The MSDN Documentation is completely useless and not updated whatsoever concerning the WebResponse class and its child-classes. Please help me with an up-to-date method or example :-) thank you.