Skip to main content
  1. Blog Posts/

When verifying Recaptcha V3 Token with google Recaptcha V3 use this Content-Type in the header

·48 words·1 min
Javascript Recaptcha V3 Javascript Recaptcha

I tried with application/json headers and couldn’t able to verify the Recaptcha V3 token.

I found this content-type is working.


const recaptchaFeedback = await fetch(
    "https://www.google.com/recaptcha/api/siteverify",
    {
      method: "POST",
      headers: {
        "Content-Type":
          "application/x-www-form-urlencoded", // Correct content type
      },
      body: new URLSearchParams({
        secret: RECAPTCHA_SECRET,
        response: recatatchaToken,
      }),
    }
  );