diff --git a/pkg/cmd/api/http.go b/pkg/cmd/api/http.go index 5f9ebc3ca..812b95af4 100644 --- a/pkg/cmd/api/http.go +++ b/pkg/cmd/api/http.go @@ -22,6 +22,12 @@ func httpRequest(client *http.Client, method string, p string, params interface{ if strings.EqualFold(method, "GET") { url = addQuery(url, pp) } else { + for key, value := range pp { + switch vv := value.(type) { + case []byte: + pp[key] = string(vv) + } + } if isGraphQL { pp = groupGraphQLVariables(pp) } diff --git a/pkg/cmd/api/http_test.go b/pkg/cmd/api/http_test.go index e2ba8680b..0f9471111 100644 --- a/pkg/cmd/api/http_test.go +++ b/pkg/cmd/api/http_test.go @@ -157,7 +157,7 @@ func Test_httpRequest(t *testing.T) { method: "POST", p: "graphql", params: map[string]interface{}{ - "a": "b", + "a": []byte("b"), }, headers: []string{}, },