This commit is contained in:
2025-07-19 22:49:32 +08:00
commit c01fd9130d
30 changed files with 1332 additions and 0 deletions

22
pkg/utils/request.go Normal file
View File

@ -0,0 +1,22 @@
package utils
import (
"crypto/tls"
"io"
"net/http"
)
func Request(method, urlStr string, body io.Reader, header http.Header) (*http.Response, error) {
req, _ := http.NewRequest(method, urlStr, body)
req.Header = header
client := http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
return resp, nil
}