Merge pull request #158 from JacobPozaic/master

Updated javascript example usage in README.md for 2.0.0 changes.
This commit is contained in:
hrj 2022-04-05 22:48:49 +05:30 committed by GitHub
commit e6b09b8d33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"})
}); });