improve(kamite): support Kamite command API change
This commit is contained in:
parent
da151015cd
commit
d392d7c4a7
|
@ -19,12 +19,12 @@
|
||||||
package gomicsv
|
package gomicsv
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
|
|
||||||
"github.com/gotk3/gotk3/gdk"
|
"github.com/gotk3/gotk3/gdk"
|
||||||
)
|
)
|
||||||
|
@ -155,9 +155,10 @@ func kamiteSendOCRImageCommand(port int, imgBytes []byte, w, h int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = http.PostForm(
|
_, err = http.Post(
|
||||||
kamiteMakeEndpointURL(port, kamiteOCRImageEndpoint),
|
kamiteMakeEndpointURL(port, kamiteOCRImageEndpoint),
|
||||||
url.Values{"params": {string(paramsJSON)}},
|
"application/json",
|
||||||
|
bytes.NewReader(paramsJSON),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error making HTTP request: %v", err)
|
log.Printf("Error making HTTP request: %v", err)
|
||||||
|
|
Loading…
Reference in a new issue