improve(kamite): support Kamite command API change

This commit is contained in:
Piotr Grabowski 2022-09-06 18:48:06 +02:00
parent da151015cd
commit d392d7c4a7

View file

@ -19,12 +19,12 @@
package gomicsv
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"github.com/gotk3/gotk3/gdk"
)
@ -155,9 +155,10 @@ func kamiteSendOCRImageCommand(port int, imgBytes []byte, w, h int) {
return
}
_, err = http.PostForm(
_, err = http.Post(
kamiteMakeEndpointURL(port, kamiteOCRImageEndpoint),
url.Values{"params": {string(paramsJSON)}},
"application/json",
bytes.NewReader(paramsJSON),
)
if err != nil {
log.Printf("Error making HTTP request: %v", err)