add support for POST body
This commit is contained in:
parent
afdebbc3a2
commit
50dd9ff483
|
@ -244,8 +244,14 @@ func (h *HttpJson) sendRequest(serverURL string) (string, float64, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create + send request
|
// Create + send request
|
||||||
|
body := data.Encode()
|
||||||
|
body_attr := data.Get('__body')
|
||||||
|
if body_attr != "" {
|
||||||
|
list := strings.Split(data.Encode(), '=')
|
||||||
|
body = list[1]
|
||||||
|
}
|
||||||
req, err := http.NewRequest(h.Method, requestURL.String(),
|
req, err := http.NewRequest(h.Method, requestURL.String(),
|
||||||
strings.NewReader(data.Encode()))
|
strings.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", -1, err
|
return "", -1, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue