Timeout Problem when Calling GetResponse()
I am trying to use the HttpWebResponse and HttpWebRequest to connect to a web address. I am expecting back XML from the address. I can access the web address and successfully get back XML when I connect to it using my web browser but when I try and access the address using the GetResponse method I get a timeout. Is there a setting I am missing that would cause a timeout?
Here is my code:
HttpWebRequest restRequest = (HttpWebRequest)WebRequest.Create("http://api.search.yahoo.com/WebSearchService/V1/webSearch?results=10&start=1&appid=MY_ID&query=sony&format=html&language=en"); restRequest.Method = "POST"; restRequest.ContentType = "application/x-www-form-urlencoded"; try { HttpWebResponse restResponse = (HttpWebResponse) restRequest.GetResponse(); return restResponse.GetResponseStream(); } catch(Exception e) { throw e; } |

