yuleduiPay/common/common.go

20 lines
439 B
Go
Raw Permalink Normal View History

2024-11-06 15:15:45 +08:00
package common
2024-11-07 18:07:35 +08:00
import (
"bytes"
"io"
"net/http"
)
2024-11-06 15:15:45 +08:00
var Layout = "2006-01-02 15:04:05"
2024-11-07 18:07:35 +08:00
var YSEPAYURL = "https://qrcode.ysepay.com/gateway.do" //银盛的微信小程序接口地址
2024-11-08 15:19:11 +08:00
func HttpPost(url string, contentType string, jsonBytes []byte) ([]byte, error) {
2024-11-07 18:07:35 +08:00
resp, err := http.Post(url, "application/json", bytes.NewReader(jsonBytes))
if err != nil {
return nil, err
}
defer resp.Body.Close()
return io.ReadAll(resp.Body)
}