-
Notifications
You must be signed in to change notification settings - Fork 1
/
recaptcha.html
34 lines (34 loc) · 1.02 KB
/
recaptcha.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head>
<title>reCAPTCHA demo: Simple page</title>
<script>
window.recaptcha_cb = (token) =>{
window.token = token
}
const submit = () => {
data = {
token: window.token,
cap: 'white hair yellow eyes',
}
fetch('http://127.0.0.1:5000/anime_heads', {
method: 'POST',
body: JSON.stringify(data),
headers: new Headers({
'Content-Type': 'application/json'
})
})
.then(function(res) {
console.log(res.text())
})
delete window.token
}
</script>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</script>
</head>
<body>
<div class="g-recaptcha" data-sitekey="6Lcb_fUUAAAAADgVNuvS161lQDZKs8G62lnBYqLN" data-callback="recaptcha_cb"></div>
</br>
<button type="button" onclick="submit()">submit</button>
</body>
</html>