I’m porting some code to Windows Phone 7. This line doesn’t seem to work:
HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
I have been trying to find an answer to it but all I can find is refrences to async methods which I have never used before. Any help is much appreciated.
Windows Phone 7 only supports asynchronous operations when it comes to HTTP requests.
Instead, you should use
httpRequest.BeginGetResponse()(more info here) and manipulate the response data in the async callback.I implemented this pattern when I was working on the Flickr API for WP7. You can see a real-world example of async HTTP request handling here.