hcaptcha 1.0.1

hcaptcha response verification
Documentation

Hcaptcha

Build the request and verify

Build the request using the Hcaptcha builder.

Execute [verify] on the request once to execute.

Following a successful response the additional response in HcaptchaResponse can be requested from the [Hcapthca] struct.

Examples

use hcaptcha::Hcaptcha;
use std::net::{IpAddr, Ipv4Addr};

#[tokio::main]
async fn main() {
let remote_ip = IpAddr::V4(Ipv4Addr::new(192, 168, 0, 17));

let res = Hcaptcha::new("your_private_key", "user_response")
.set_user_ip(&remote_ip)
.verify()
.await;

if res.is_ok() {
println!("Success");
} else {
println!("Failure");
}
}

Feature Flags

  • logging: Enbles debug logs for the request and response structs.