20 lines
439 B
Go
20 lines
439 B
Go
package common
|
|
|
|
import (
|
|
"bytes"
|
|
"io"
|
|
"net/http"
|
|
)
|
|
|
|
var Layout = "2006-01-02 15:04:05"
|
|
var YSEPAYURL = "https://qrcode.ysepay.com/gateway.do" //银盛的微信小程序接口地址
|
|
|
|
func HttpPost(url string, contentType string, jsonBytes []byte) ([]byte, error) {
|
|
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)
|
|
}
|