package httprequest import ( "crypto/tls" "fmt" "net/http" "strings" ) func HttpRequest(url, method, requestBody string) (*http.Response, error) { // TLS 설정 tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // 인증서 검증 비활성화 } client := &http.Client{Transport: tr} // client := &http.Client{} payload := strings.NewReader(requestBody) req, _ := http.NewRequest(method, url, payload) req.Header.Set("Content-Type", "application/json") // 요청 res, err := client.Do(req) if err != nil { return nil, fmt.Errorf("요청 오류: %w", err) } if res.StatusCode != http.StatusOK { return nil, fmt.Errorf("error: received non-200 response status: %s", res.Status) } return res, nil }