-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_test.go
29 lines (27 loc) · 2.69 KB
/
client_test.go
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
package yescaptcha
import (
"fmt"
"testing"
)
func TestClient(t *testing.T) {
client := NewClient("", "21585", "")
response, err := client.GetBalance()
if err != nil {
fmt.Println(err.Error())
} else {
fmt.Println(response.Balance)
}
//taskResponse, err := client.CreateImageToText(&req.ImageToTextTaskRequest{Type: task.ImageToTextTaskM1, Body: "iVBORw0KGgoAAAANSUhEUgAAAIAAAAAmCAYAAAAMe5M4AAAF00lEQVR42u1b+Ss9XRi/9uxLliL7FkIRRaKUJUqJ+AGRnWRN2aKUIiL7ElHWsiX77j87b5/zdqYxZu69vnfmuNz54cncmTPnmfM8n/Osh+Hj44PoZLtk0IWgA0AXhA4AnXQA6KQDQCd5enl5IbGxscRgMAikA8CGqK6u7pPybRYARUVFZG1tzeYAYG9vTxwcHGwPAKGhocTV1ZU4OzuT4OBgunA7OztSU1NDhoaGbEL56+vrdN319fW2AYDDw0PS3d1NsrKyvpg9Nzc34TouLo6rD/4J4Tw+PtJNEBMTQ7/hTwIAiystLSU9PT1kc3Pz0yIPDg6oEM7OzkhfXx8ZHBwUnrm4uHD1weIgjBffiooKym9nZ+d/Yf1FAEh3OcjX15dkZmZSUGxvb5PX11c6+PLyUhgTGBjIZQfCBMMH8w7CFhYWqLtzcnLiqvybmxvy/v5OpqamSG5uLvH396ff4OXlReLj40lTUxO5vb1VDwBQMHZ2eXk5ZQB/LxU27uEZLAW7x0Ch9Q6ECQY/3kEYeEDY4t9a8357eyNpaWl088ltTEYAxcbGhjYxABQrBgVchFT4YlBUVlaS0dFRsru7q8kOBC98A68gDLsrKCiIrk0Mch68x8bGPvHBumdnZ8nDwwMlXOMensEinJyc8EkDn56eSHNzM2Xs6elJoqKiZEGBjCE5OdkiUDAFsB0I8wcfzCsIKy4upvPv7e19sQha887IyBB4hIeHk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PYlnSDMP7DQ0NNLqXewebElZF/7+AX0bmNsNQ1sVBXBS4WAqIXgiaRHhXq+BbB8APg8JY3wOgYH2P6elp6hp0APxRgnKhZFPNMNwXg8LSZpgOACsHBet7wD3AIqjdDNMB8MtI3AwDKIw1wwAKk80wXai/nyxqhukC/NugMNb3oKQLy3ZIrhn2H5DYuFY7EflGAAAAAElFTkSuQmCC"})
//if err != nil {
// fmt.Println(err.Error())
//} else {
// fmt.Println(taskResponse.TaskId)
//}
// 6ba4e134-08d2-11ee-865a-e2369b0517b2
resultResponse, err := client.GetTaskResult("6ba4e134-08d2-11ee-865a-e2369b0517b2")
if err != nil {
fmt.Println(err.Error())
} else {
fmt.Println(resultResponse.Solution)
}
}