This commit is contained in:
2025-04-15 21:11:54 +08:00
commit 1927412d3f
30 changed files with 1333 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
}