Prometheus: Set default method to POST in new HTTP client (#49198)

This commit is contained in:
Todd Treece 2022-05-18 15:44:41 -04:00 committed by GitHub
parent 5b52a1c391
commit 859cc92da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,8 @@
package client
import (
"net/http"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
@ -31,6 +33,9 @@ func NewProvider(
log log.Logger,
) *Provider {
httpMethod, _ := maputil.GetStringOptional(jsonData, "httpMethod")
if httpMethod == "" {
httpMethod = http.MethodPost
}
return &Provider{
settings: settings,
jsonData: jsonData,