Document required HTTP headers for /recaptcha/api/verify

1,985 views
Skip to first unread message

Sam Holmes

unread,
Sep 6, 2012, 7:00:44 PM9/6/12
to reca...@googlegroups.com
Reference: http://stackoverflow.com/questions/7450465/i-keep-receiving-invalid-site-private-key-on-my-recaptcha-validation-request

These are the header parameters which are obviously necessary (they imply you're sending a form):

  • Content-Length which has to be the length of the query string
  • Content-Type which has to be application/x-www-form-urlencoded

I didn't send any request headers as there was nothing stated in the documentation. Everything that is said concerning the request before they explain the necessary parameters is the following:

"After your page is successfully displaying reCAPTCHA, you need to configure your form to check whether the answers entered by the users are correct. This is achieved by doing a POST request to http://www.google.com/recaptcha/api/verify. Below are the relevant parameters."

-- "How to Check the User's Answer" at http://code.google.com/apis/recaptcha/docs/verify.html

These two required headers must be documented somewhere.

Adrian Godong

unread,
Sep 6, 2012, 7:09:52 PM9/6/12
to reca...@googlegroups.com
For .NET, you only need to set the ContentType property as the length
will be automatically calculated.

I guess it's pretty intuitive to tell the target server about what
kind of data you are sending, regardless of documentation. Having said
that, I do agree that some parts are sometimes trial and error (like
you can't use HTTP 1.1 on most occasion, can't remember why but the
code exist for a reason) and it should be documented properly -- and
experienced developers will know that documentation often lags behind
the code. If you're writing from scratch, I suggest reading up
existing codebase from other platform and derive from it.
> --
> You received this message because you are subscribed to the Google Groups
> "reCAPTCHA" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/recaptcha/-/508wtqTN-dcJ.
> To post to this group, send email to reca...@googlegroups.com.
> To unsubscribe from this group, send email to
> recaptcha+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/recaptcha?hl=en.



--
Adrian Godong
adrian...@gmail.com
Reply all
Reply to author
Forward
0 new messages