From d392d7c4a753eadba3c780042586d5ac03507735 Mon Sep 17 00:00:00 2001 From: Piotr Grabowski Date: Tue, 6 Sep 2022 18:48:06 +0200 Subject: [PATCH] improve(kamite): support Kamite command API change --- kamite.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kamite.go b/kamite.go index cea8a00..d896e81 100644 --- a/kamite.go +++ b/kamite.go @@ -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)