fix memory leak and events

This commit is contained in:
tarancss
2022-09-17 01:18:56 +02:00
parent 4f0536a933
commit 8677b3be7e
8 changed files with 84 additions and 56 deletions

View File

@@ -2,12 +2,16 @@ package networking
import (
"bytes"
"github.com/juju/errors"
"fmt"
"net/http"
"github.com/juju/errors"
)
// SendSoap send soap message
func SendSoap(httpClient *http.Client, endpoint, message string) (*http.Response, error) {
fmt.Printf("SendSoap message:%s\n", message)
resp, err := httpClient.Post(endpoint, "application/soap+xml; charset=utf-8", bytes.NewBufferString(message))
if err != nil {
return resp, errors.Annotate(err, "Post")