working commit

This commit is contained in:
2026-02-12 14:51:16 +02:00
parent a9526f73a2
commit e4d9a6d161
7 changed files with 281 additions and 93 deletions
+21 -4
View File
@@ -13,17 +13,34 @@ import (
"bytes"
"context"
"crypto/tls"
//"encoding/json"
"fmt"
"io"
"net/http"
//"net/url"
"net/url"
"strings"
//"mstore/app/handler"
//"mstore/app/operator"
"mstore/pkg/auxhttp"
)
func setApiPath(base, apipath string) (string, error) {
var res string
if !strings.Contains(base, "://") {
base = "https://" + base
}
uri, err := url.Parse(base)
if err != nil {
return res, err
}
uri.Path = "/"
uri.Path, err = url.JoinPath(uri.Path, apipath)
if err != nil {
return res, err
}
res = uri.String()
return res, nil
}
func doHTTPCall(ctx context.Context, apiuri string, reqBytes []byte) ([]byte, error) {
var err error
respBytes := make([]byte, 0)