Use this class to check the throttling state of client requests.
Parameters: |
|
---|
Returns the throttling state for a given request. You should call this method before processing a request to find out if a request should be blocked, if a captcha must be validated before processing the request, or if no action is needed before proceeding. You can also call this method before presenting a page to the user in order to find out what you should present: a message saying the user is blocked, a captcha for the user to fill, or neither.
Parameters: |
|
---|---|
Returns: | dict – A dictionary with the requested throttling state. It always has a ‘state’ key which can have three values: ‘ok’, ‘captcha’ and ‘block’ (meaning should be obvious from the documentation above). If ‘state’ is ‘block’ there is an additional key called ‘unblock_timestamp’ which will contain a timestamp of the time when the ‘block’ state will end. This can be used to tell the client when he will be unblocked. |