title: ReCaptcha 2.0 The Remote Server Returned an ERror (Bad Request)
body: <p>I have the following Recaptcha call in my app</p>
  
  <pre><code>var result = false;
  
          var apiUrl = "https://www.google.com/recaptcha/api/siteverify";
  
          var request = (HttpWebRequest)WebRequest.Create(apiUrl);
          request.Method = "POST";
  
  
          string postString = string.Format("secret={0}&amp;response={1}&amp;remoteIp=127.0.0.1", ReCaptcha_Secret, res);
          const string contentType = "application/x-www-form-urlencoded";
          byte[] byteArray = Encoding.UTF8.GetBytes(postString);
          request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
          request.ContentType = contentType;
          request.ContentLength = postString.Length;
          StreamWriter requestWriter = new StreamWriter(request.GetRequestStream());
          requestWriter.Write(postString);
          requestWriter.Close();
  
  
          try
          {
              using (WebResponse response = request.GetResponse())
              {
                  using (StreamReader stream = new StreamReader(response.GetResponseStream()))
                  {
                      JObject jResponse = JObject.Parse(stream.ReadToEnd());
                      var isSuccess = jResponse.Value&lt;bool&gt;("success");
                      result = (isSuccess) ? true : false;
                  }
              }
              return result;
          }
          catch (Exception e)
          {
              return false;
          }
  </code></pre>
  
  <p>The secret and the response are correct, but no matter what I do I always receive the message: </p>
  
  <blockquote>
    <p>{"The remote server returned an error: (400) Bad Request."}</p>
  </blockquote>
  
  <p>It is from My dev environment and I have 127.0.0.1 registered with captcha</p>
  
  <p>am I missing something here? Ive spent a day trying to get this to work, on a job that I allocated 2 hours work for.</p>
  
  <p>Any suggestions?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>res is the response code generated by the Captcha challange to the user
  According to the docs I need this and the secret_key to get my response</p>