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

@@ -3,6 +3,7 @@ package api
import (
"context"
"fmt"
"net/http"
)
// Help wraps HelpWithContext using context.Background.
@@ -15,7 +16,7 @@ func (c *Client) HelpWithContext(ctx context.Context, path string) (*Help, error
ctx, cancelFunc := c.withConfiguredTimeout(ctx)
defer cancelFunc()
r := c.NewRequest("GET", fmt.Sprintf("/v1/%s", path))
r := c.NewRequest(http.MethodGet, fmt.Sprintf("/v1/%s", path))
r.Params.Add("help", "1")
resp, err := c.rawRequestWithContext(ctx, r)