File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ website := arcaptcha.NewWebsite("YOUR_SITE_KEY", "YOUR_SECRET_KEY")
2727// After you put captcha widget in your website, you can get 'arcaptcha-response' from form
2828result , err := website.Verify (" arcaptcha-response" )
2929if err != nil {
30- // error in sending or receiving API request
31- // handle error
30+ // error in sending or receiving API request
31+ // handle error
3232}
3333if !result.Success {
34- // captcha not verified
35- // can see result.ErrorCodes to find what's wrong
36- // throw specific error
34+ // captcha not verified
35+ // can see result.ErrorCodes to find what's wrong
36+ // throw specific error
3737}
3838// it's ok
3939```
@@ -82,4 +82,12 @@ func verifyCaptcha(next http.Handler) http.Handler {
8282 next.ServeHTTP (w, r)
8383 })
8484}
85+ ```
86+
87+ you can set ` timeout ` for verify request:
88+
89+ ``` go
90+ website := arcaptcha.NewWebsite (" YOUR_SITE_KEY" , " YOUR_SECRET_KEY" )
91+ website.SetTimeout (1 *time.Second )
92+ result , err := website.Verify (" arcaptcha-response" ) // returns "context deadline" error if it takes more than 1 second
8593```
You can’t perform that action at this time.
0 commit comments