api: fix bugs

This commit is contained in:
George Palanjyan
2018-04-10 14:20:39 +03:00
parent 715eb71927
commit 3eb889f611
3 changed files with 7 additions and 88 deletions

View File

@@ -3,11 +3,9 @@ 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))
@@ -15,18 +13,5 @@ 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))
}*/
//b, err := ioutil.ReadAll(resp.Body)
//if err != nil {
// return resp, err
//}
//fmt.Println(endpoint)
//fmt.Println(string(b))
//log.Println(resp.StatusCode)
return resp,nil
}