diff --git a/.gitignore b/.gitignore index d969c09..a985b65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /config.yml /config.json -examples/ \ No newline at end of file +examples/ +.idea \ No newline at end of file diff --git a/http.go b/http.go index 27c8b3a..1d7cc0f 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,7 @@ type HTTPMonitor struct { // TODO: test func (monitor *HTTPMonitor) test() bool { - req, err := http.NewRequest(monitor.Method, monitor.Target, nil) + req, err := http.NewRequest(monitor.Method, monitor.Target, strings.NewReader(monitor.Body)) for k, v := range monitor.Headers { req.Header.Add(k, v) }