feat(outputs.http): Allow PATCH method (#13651)
This commit is contained in:
parent
5d51052941
commit
25f545ccb9
|
|
@ -33,7 +33,7 @@ to use them.
|
||||||
## Timeout for HTTP message
|
## Timeout for HTTP message
|
||||||
# timeout = "5s"
|
# timeout = "5s"
|
||||||
|
|
||||||
## HTTP method, one of: "POST" or "PUT"
|
## HTTP method, one of: "POST" or "PUT" or "PATCH"
|
||||||
# method = "POST"
|
# method = "POST"
|
||||||
|
|
||||||
## HTTP Basic Auth credentials
|
## HTTP Basic Auth credentials
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ func (h *HTTP) Connect() error {
|
||||||
h.Method = http.MethodPost
|
h.Method = http.MethodPost
|
||||||
}
|
}
|
||||||
h.Method = strings.ToUpper(h.Method)
|
h.Method = strings.ToUpper(h.Method)
|
||||||
if h.Method != http.MethodPost && h.Method != http.MethodPut {
|
if h.Method != http.MethodPost && h.Method != http.MethodPut && h.Method != http.MethodPatch {
|
||||||
return fmt.Errorf("invalid method [%s] %s", h.URL, h.Method)
|
return fmt.Errorf("invalid method [%s] %s", h.URL, h.Method)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
## Timeout for HTTP message
|
## Timeout for HTTP message
|
||||||
# timeout = "5s"
|
# timeout = "5s"
|
||||||
|
|
||||||
## HTTP method, one of: "POST" or "PUT"
|
## HTTP method, one of: "POST" or "PUT" or "PATCH"
|
||||||
# method = "POST"
|
# method = "POST"
|
||||||
|
|
||||||
## HTTP Basic Auth credentials
|
## HTTP Basic Auth credentials
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue