def render_POST(self, request):
"""Process a client's CAPTCHA solution.
If the client's CAPTCHA solution is valid (according to
:meth:`checkSolution`), process and serve their original
request. Otherwise, redirect them back to a new CAPTCHA page.
:type request: :api:`twisted.web.http.Request`
:param request: A ``Request`` object, including POST arguments which
should include two key/value pairs: one key being
``'captcha_challenge_field'``, and the other,
``'captcha_response_field'``. These POST arguments should be
obtained from :meth:`render_GET`.
:rtype: str
:returns: A rendered HTML page containing a ReCaptcha challenge image
for the client to solve.
"""
data = {
"data": {
"id": 3,
"type": self.responseType,
"version": FARFETCHD_API_VERSION,
"result": False,
}
}
try:
if self.checkSolution(request) is True:
data["data"]["result"] = True
return self.formatResponse(data, request)
else:
return self.failureResponse(request)
except Exception as err:
log.err(err)
#class FarfetchdRequestHandler(http.Request):
评论列表
文章目录