goonvif/onvif/networking/networking.go

18 lines
396 B
Go
Raw Permalink Normal View History

2024-10-31 18:22:47 +08:00
package networking
import (
"bytes"
"github.com/juju/errors"
"net/http"
)
// SendSoap send soap message
func SendSoap(httpClient *http.Client, endpoint, message string) (*http.Response, error) {
resp, err := httpClient.Post(endpoint, "application/soap+xml; charset=utf-8", bytes.NewBufferString(message))
if err != nil {
return resp, errors.Annotate(err, "Post")
}
return resp, nil
}