diff --git a/http.go b/http.go index 27c8b3a..017d7c6 100644 --- a/http.go +++ b/http.go @@ -32,6 +32,7 @@ type HTTPMonitor struct { AbstractMonitor `mapstructure:",squash"` Method string + Body string ExpectedStatusCode int `mapstructure:"expected_status_code"` Headers map[string]string @@ -42,7 +43,8 @@ type HTTPMonitor struct { // TODO: test func (monitor *HTTPMonitor) test() bool { - req, err := http.NewRequest(monitor.Method, monitor.Target, nil) + bodyReader := strings.NewReader(monitor.Body) + req, err := http.NewRequest(monitor.Method, monitor.Target, bodyReader) for k, v := range monitor.Headers { req.Header.Add(k, v) }