insecure_skip_verify: false
protocol: "tcp" # accepts "tcp/tcp4/tcp6", defaults to "tcp"
preferred_ip_protocol: "ip4" # used for "tcp", defaults to "ip6"
+ http_post_2xx:
+ prober: http
+ timeout: 5s
+ http:
+ method: POST
+ headers:
+ Content-Type: application/json
+ body: '{}'
tcp_connect_v4_example:
prober: tcp
timeout: 5s
request.Header.Set(key, value)
}
+ // If a body is configured, add it to the request
+ if config.Body != "" {
+ request.Body = ioutil.NopCloser(strings.NewReader(config.Body))
+ }
+
resp, err := client.Do(request)
// Err won't be nil if redirects were turned off. See https://github.com/golang/go/issues/3795
if err != nil && resp == nil {
TLSConfig config.TLSConfig `yaml:"tls_config"`
Protocol string `yaml:"protocol"` // Defaults to "tcp".
PreferredIpProtocol string `yaml:"preferred_ip_protocol"` // Defaults to "ip6".
+ Body string `yaml:"body"`
}
type QueryResponse struct {