1 unstable release

0.1.0 Jan 2, 2024

#1422 in Web programming

MIT/Apache

11KB
179 lines

status-badge


mcaptcha-api-rs: Library to interact with with mCaptcha API

This library provides a convenient interface to validate mCaptcha authorization tokens presented by Visitors against your mCaptcha instances. It uses reqwest, and native-tls under the hood to communicate with the API.

Install

cargo add mcaptcha-api-rs

Example

use url::Url;
use mcaptcha_api_rs::MCaptcha;

let mcaptcha = MCaptcha::new("sitekeyfromdashboard", "secretfromdashboadr", Url::parse("https://mcaptcha.example.com").unwrap());
assert!(mcaptcha.verify("authorizationtokenfromvisitor").await.unwrap());

lib.rs:

mcaptcha-api-rs: Library to interact with with mCaptcha API

This library provides a convenient interface to validate mCaptcha authorization tokens presented by Visitors against your mCaptcha instances. It uses reqwest, and native-tls under the hood to communicate with the API.

 use url::Url;
 use mcaptcha_api_rs::MCaptcha;

 let mcaptcha = MCaptcha::new("sitekeyfromdashboard", "secretfromdashboadr", Url::parse("https://mcaptcha.example.com").unwrap());
 assert!(mcaptcha.verify("authorizationtokenfromvisitor").await.unwrap());

Dependencies

~4–18MB
~252K SLoC