Updated javascript example usage in README.md for 2.0.0 changes.

Signed-off-by: jacobp <jacobpozaic@gmail.com>
This commit is contained in:
JacobPozaic 2022-04-05 10:30:31 -04:00 committed by jacobp
parent 41afb10cb5
commit a43b18587e

View File

@ -173,9 +173,9 @@ The service can be accessed using a simple HTTP API.
In javascript:
```js
const resp = await fetch("/v1/captcha", {
const resp = await fetch("/v2/captcha", {
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();
@ -193,7 +193,7 @@ if (resp.ok) {
// 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',
body: JSON.stringify({id: captchaId, answer: "user input"})
});