hcaptcha v0.0.2 Hcaptcha.Http View Source

Responsible for managing HTTP requests to the hCAPTCHA API

Link to this section Summary

Functions

Sends an HTTP request to the hCAPTCHA version 2.0 API

Link to this section Functions

Link to this function

request_verification(body, options \\ []) View Source
request_verification(binary(), [{:timeout, integer()}]) ::
  {:ok, map()} | {:error, [atom()]}

Sends an HTTP request to the hCAPTCHA version 2.0 API.

See the docs for more details on the API response.

Options

  • :timeout - the timeout for the request (defaults to 5000ms)

Example

{:ok, %{

"success" => success,
"challenge_ts" => ts,
"hostname" => host,
"error-codes" => errors

}} = Hcaptcha.Http.request_verification(%{

secret: "secret",
response: "response",
remote_ip: "remote_ip"

})