The problem is here:
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
String answer = response.ToString();
You're just calling ToString()
on the HttpWebResponse
, whereas presumably what you really want to do is get the contents of the body of the response - which you'd do with something like this:
// It's important to dispose of responses...
using (var response = request.GetResponse())
{
using (var reader = new StreamReader(response.GetResponseStream()))
{
string answer = reader.ReadToEnd();
}
}