This commit is contained in:
zhaoxiaorong 2025-05-27 09:41:00 +08:00
commit 8c62f529e3
2 changed files with 12 additions and 2 deletions

View File

@ -58,8 +58,8 @@ var (
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
const (
signKey = "8E853B589944FF7A56BEF02AAA51D6F4"
LICENCE_KEY = "TRAIN_LICENCE_KEY"
signKey = "1F36659EC27CFFF849E068EA80B1A4CA"
LICENCE_KEY = "BLOCKS_KEY"
)
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -2,6 +2,7 @@ package utils
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
@ -121,6 +122,15 @@ func HttpGet(url string) ([]byte, error) {
return body, err
}
func HttpPostJSON(url string, header map[string]string, data map[string]any) ([]byte, error) {
bytes, err := json.Marshal(data)
if err != nil {
return nil, err
}
return HttpPost(url, header, bytes)
}
func HttpPost(url string, header map[string]string, data []byte) ([]byte, error) {
var err error
reader := bytes.NewBuffer(data)