Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type CaptchaId = Text
- type PollingInterval = Int
- type TimeoutDuration = Integer
- captchaTimeout :: TimeoutDuration
- pollingInterval :: PollingInterval
- data Captcha = MkCaptcha {
- _options :: Options
- _partTexts :: [(Text, Text)]
- _partFiles :: [(Text, FilePath)]
- partTexts :: Lens' Captcha [(Text, Text)]
- partFiles :: Lens' Captcha [(Text, FilePath)]
- options :: Lens' Captcha Options
- parts :: Getter Captcha [Part]
- defaultCaptcha :: Captcha
- mkPartLens :: (Coercible Captcha a, IsString s) => Lens' Captcha [(Text, s)] -> Text -> Lens' a (Maybe s)
- mkPartTextLens :: Coercible Captcha a => Text -> Lens' a (Maybe Text)
- mkPartFileLens :: Coercible Captcha a => Text -> Lens' a (Maybe FilePath)
- mkParamLens :: Coercible Captcha a => Text -> Lens' a (Maybe Text)
- mkParamLens' :: (Coercible Captcha a, Show b, Read b) => Text -> Lens' a (Maybe b)
- mkParamLensBool :: Coercible Captcha a => Text -> Lens' a (Maybe Bool)
- class Coercible Captcha a => HasCaptchaLenses a where
- class Coercible Captcha a => HasCommonCaptchaLenses a where
- newtype CaptchaRes = CaptchaRes Captcha
- captchaRes :: CaptchaRes
- captchaId :: Lens' CaptchaRes (Maybe Text)
- class Coercible Captcha a => HasPageURL a where
- class Coercible Captcha a => HasProxy a where
- class Coercible Captcha a => HasLocalImage a where
- class Coercible Captcha a => HasLanguage a where
- class Coercible Captcha a => HasUserAgent a where
- class Coercible Captcha a => HasCookies a where
Documentation
type PollingInterval = Int Source #
Time in milliseconds in how often to request the answer.
type TimeoutDuration = Integer Source #
Time in milliseconds on when to timeout if the request takes too long.
captchaTimeout :: TimeoutDuration Source #
Default captcha timeout duration (120 seconds).
pollingInterval :: PollingInterval Source #
Default polling interval (10 seconds).
Represents the request information required to solve a captcha.
MkCaptcha | |
|
parts :: Getter Captcha [Part] Source #
Convert the captcha's multipart form parameters into a [Part
].
defaultCaptcha :: Captcha Source #
Default parameters for solving a captcha. Internal use only.
mkPartLens :: (Coercible Captcha a, IsString s) => Lens' Captcha [(Text, s)] -> Text -> Lens' a (Maybe s) Source #
Create a lens using the given field name for multipart forms.
mkPartTextLens :: Coercible Captcha a => Text -> Lens' a (Maybe Text) Source #
Create a lens using the given field name for multipart form texts.
mkPartFileLens :: Coercible Captcha a => Text -> Lens' a (Maybe FilePath) Source #
Create a lens using the given field name for multipart form files.
mkParamLens :: Coercible Captcha a => Text -> Lens' a (Maybe Text) Source #
Creates a lens using the given field name for query parameters.
class Coercible Captcha a => HasCaptchaLenses a where Source #
Lenses for constructing options for submit
.
Nothing
softId :: Lens' a (Maybe Int) Source #
Software developer id. Developers who integrate their software with 2captcha earn 10% of the user's spendings.
pingback :: Lens' a (Maybe Text) Source #
URL for pingback (callback) response that will be sent the answer to when the captcha is solved.
method :: Lens' a (Maybe Text) Source #
Type of captcha to solve.
Instances
class Coercible Captcha a => HasCommonCaptchaLenses a where Source #
Nothing
apiKey :: Lens' a (Maybe Text) Source #
Your 2captcha API key.
headerACAO :: Lens' a (Maybe Bool) Source #
If True, submit
will include the Access-Control-Allow-Origin:* header in the response.
Used for cross-domain AJAX requests in web applications.
Instances
newtype CaptchaRes Source #
Parameters used to retrieve the answer
of a solved captcha.
Instances
Show CaptchaRes Source # | |
Defined in TwoCaptcha.Internal.Types.Captcha showsPrec :: Int -> CaptchaRes -> ShowS # show :: CaptchaRes -> String # showList :: [CaptchaRes] -> ShowS # | |
HasCommonCaptchaLenses CaptchaRes Source # | |
Defined in TwoCaptcha.Internal.Types.Captcha apiKey :: Lens' CaptchaRes (Maybe Text) Source # headerACAO :: Lens' CaptchaRes (Maybe Bool) Source # |
captchaRes :: CaptchaRes Source #
Parameters for retrieving a captcha's answer.
Required parameters:
Optional parameters:
class Coercible Captcha a => HasPageURL a where Source #
Nothing
Instances
class Coercible Captcha a => HasProxy a where Source #
Nothing
proxy :: Lens' a (Maybe Text) Source #
Proxy to be sent to the worker who solves the captcha. You can read more about proxies here.
Format must be in login:password@123.123.123.123:3128 .
proxyType :: Lens' a (Maybe Text) Source #
Type of your proxy: HTTP, HTTPS, SOCKS4, SOCKS5.
Instances
class Coercible Captcha a => HasLocalImage a where Source #
Nothing
file :: Lens' a (Maybe FilePath) Source #
File path of a captcha image.
body :: Lens' a (Maybe Text) Source #
Base-64 encoded image.
textInstructions :: Lens' a (Maybe Text) Source #
Text which is shown to the worker to help solve a captcha.
imgInstructions :: Lens' a (Maybe FilePath) Source #
Image file path with instructions on solving a captcha.
Instances
class Coercible Captcha a => HasLanguage a where Source #
Nothing
language :: Lens' a (Maybe Int) Source #
The captcha's language:
- Not specified.
- Cyrillic captcha.
- Latin captcha.
languageCode :: Lens' a (Maybe Text) Source #
The captcha's language code. Click here for a list of supported languages.
Instances
class Coercible Captcha a => HasUserAgent a where Source #
Nothing
userAgent :: Lens' a (Maybe Text) Source #
User agent that will be used by the worker when solving the captcha.
Instances
class Coercible Captcha a => HasCookies a where Source #
Nothing
cookies :: Lens' a (Maybe Text) Source #
Cookies that will be used by the worker solving the captcha. The used cookies will also be included in the response.
Format: KEY1:Value1;KEY2:Value2;