Replace http method strings with net/http constants (#14677)

This commit is contained in:
Anton Averchenkov
2022-03-24 13:58:03 -04:00
committed by GitHub
parent 7f36a29e04
commit 0dd4cda7c9
26 changed files with 142 additions and 109 deletions

View File

@@ -1,6 +1,9 @@
package api
import "context"
import (
"context"
"net/http"
)
func (c *Sys) StepDown() error {
return c.StepDownWithContext(context.Background())
@@ -10,7 +13,7 @@ func (c *Sys) StepDownWithContext(ctx context.Context) error {
ctx, cancelFunc := c.c.withConfiguredTimeout(ctx)
defer cancelFunc()
r := c.c.NewRequest("PUT", "/v1/sys/step-down")
r := c.c.NewRequest(http.MethodPut, "/v1/sys/step-down")
resp, err := c.c.rawRequestWithContext(ctx, r)
if resp != nil && resp.Body != nil {