mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-04-20 18:44:01 -04:00
Merge pull request #158 from JacobPozaic/master
Updated javascript example usage in README.md for 2.0.0 changes.
This commit is contained in:
commit
e6b09b8d33
@ -173,9 +173,9 @@ The service can be accessed using a simple HTTP API.
|
|||||||
In javascript:
|
In javascript:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const resp = await fetch("/v1/captcha", {
|
const resp = await fetch("/v2/captcha", {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({level: "easy", media: "image/png", "input_type" : "text"})
|
body: JSON.stringify({level: "easy", media: "image/png", "input_type" : "text", size: "350x100"})
|
||||||
})
|
})
|
||||||
|
|
||||||
const respJson = await resp.json();
|
const respJson = await resp.json();
|
||||||
@ -193,7 +193,7 @@ if (resp.ok) {
|
|||||||
|
|
||||||
|
|
||||||
// When user submits an answer it can be sent to the server for verification thusly:
|
// When user submits an answer it can be sent to the server for verification thusly:
|
||||||
const resp = await fetch("/v1/answer", {
|
const resp = await fetch("/v2/answer", {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({id: captchaId, answer: "user input"})
|
body: JSON.stringify({id: captchaId, answer: "user input"})
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user