mirror of
https://github.com/kerberos-io/onvif.git
synced 2025-10-08 09:10:17 +08:00
20 lines
341 B
Go
20 lines
341 B
Go
package networking
|
|
|
|
import (
|
|
"net/http"
|
|
"bytes"
|
|
"io/ioutil"
|
|
)
|
|
|
|
func SendSoap(endpoint, message string) string {
|
|
httpClient := new(http.Client)
|
|
|
|
resp, _ := httpClient.Post(endpoint, "application/soap+xml; charset=utf-8", bytes.NewBufferString(message))
|
|
|
|
b, _ := ioutil.ReadAll(resp.Body)
|
|
|
|
//log.Println(string(b))
|
|
|
|
return string(b)
|
|
}
|