WS-security update(moved to gosoap progect), return error on HTTP digest authentification required

This commit is contained in:
yakovlevdmv
2018-04-10 02:59:48 +03:00
parent 093ae52fa5
commit b302c5c92b
2 changed files with 15 additions and 36 deletions

View File

@@ -3,9 +3,11 @@ package networking
import (
"net/http"
"bytes"
"fmt"
)
func SendSoap(endpoint, message string) (*http.Response, error) {
fmt.Println(message)
httpClient := new(http.Client)
resp, err := httpClient.Post(endpoint, "application/soap+xml; charset=utf-8", bytes.NewBufferString(message))
@@ -13,6 +15,8 @@ func SendSoap(endpoint, message string) (*http.Response, error) {
return resp, err
}
fmt.Println(resp.Header)
/*if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusBadRequest {
return "", errors.New("error: got HTTP response status " + strconv.Itoa(resp.StatusCode))
}*/