Added Analytics datatypes. Changing namespaces prefix at struct tags

This commit is contained in:
yakovlevdmv
2018-04-05 06:15:00 +03:00
parent d93d40283a
commit d5ca888bc4
8 changed files with 638 additions and 492 deletions

View File

@@ -4,17 +4,19 @@ import (
"net/http"
"bytes"
"io/ioutil"
"log"
)
func SendSoap(endpoint, message string) string {
func SendSoap(endpoint, message string) (string, error) {
httpClient := new(http.Client)
resp, _ := httpClient.Post(endpoint, "application/soap+xml; charset=utf-8", bytes.NewBufferString(message))
resp, err := httpClient.Post(endpoint, "application/soap+xml; charset=utf-8", bytes.NewBufferString(message))
if err != nil {
return "", err
}
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
b, _ := ioutil.ReadAll(resp.Body)
log.Println(string(b))
return string(b)
return string(b),nil
}