Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- handle :: (MonadIO m, MonadCatch m) => IO (Response ByteString) -> m Text
- class TwoCaptchaClient m where
- submit :: (Coercible Captcha a, HasCaptchaLenses a, HasCommonCaptchaLenses a) => Session -> a -> m CaptchaId
- answer :: Session -> CaptchaRes -> m Text
- solve :: (Coercible Captcha a, HasCaptchaLenses a, HasCommonCaptchaLenses a) => PollingInterval -> TimeoutDuration -> Session -> a -> m Text
Documentation
handle :: (MonadIO m, MonadCatch m) => IO (Response ByteString) -> m Text Source #
Runs the given http method and adapts errors to TwoCaptchaException
.
class TwoCaptchaClient m where Source #
Encapsulates the in.php and res.php endpoints for the 2captcha API.
submit :: (Coercible Captcha a, HasCaptchaLenses a, HasCommonCaptchaLenses a) => Session -> a -> m CaptchaId Source #
Submit a captcha to be solved by the 2captcha API. Returns a captcha id used for answer
.
answer :: Session -> CaptchaRes -> m Text Source #
Attempt to retrieve the answer of a captcha previously submitted.
solve :: (Coercible Captcha a, HasCaptchaLenses a, HasCommonCaptchaLenses a) => PollingInterval -> TimeoutDuration -> Session -> a -> m Text Source #
Submits a captcha and polls for the answer.
Instances
(MonadIO m, MonadCatch m) => TwoCaptchaClient m Source # | |
Defined in TwoCaptcha.Internal.Client submit :: (Coercible Captcha a, HasCaptchaLenses a, HasCommonCaptchaLenses a) => Session -> a -> m CaptchaId Source # answer :: Session -> CaptchaRes -> m Text Source # solve :: (Coercible Captcha a, HasCaptchaLenses a, HasCommonCaptchaLenses a) => PollingInterval -> TimeoutDuration -> Session -> a -> m Text Source # |