diff --git a/internal/api/rest_client.go b/internal/api/rest_client.go index 072dc13..f1651e2 100644 --- a/internal/api/rest_client.go +++ b/internal/api/rest_client.go @@ -23,7 +23,7 @@ func NewRESTClient(host string, opts *api.ClientOptions) api.RESTClient { } } -func (c restClient) Raw(method string, path string, body io.Reader) (*http.Response, error) { +func (c restClient) Request(method string, path string, body io.Reader) (*http.Response, error) { url := restURL(c.host, path) req, err := http.NewRequest(method, url, body) if err != nil { diff --git a/internal/api/rest_client_test.go b/internal/api/rest_client_test.go index 7c3f659..ea97aa5 100644 --- a/internal/api/rest_client_test.go +++ b/internal/api/rest_client_test.go @@ -11,7 +11,7 @@ import ( "gopkg.in/h2non/gock.v1" ) -func TestRESTClientRaw(t *testing.T) { +func TestRESTClientRequest(t *testing.T) { tests := []struct { name string host string @@ -104,7 +104,7 @@ func TestRESTClientRaw(t *testing.T) { tt.httpMocks() } client := NewRESTClient(tt.host, nil) - resp, err := client.Raw("GET", tt.path, nil) + resp, err := client.Request("GET", tt.path, nil) t.Cleanup(func() { resp.Body.Close() }) body, readErr := io.ReadAll(resp.Body) assert.NoError(t, readErr) diff --git a/pkg/api/client.go b/pkg/api/client.go index e2538e3..f4feb0f 100644 --- a/pkg/api/client.go +++ b/pkg/api/client.go @@ -84,11 +84,11 @@ type RESTClient interface { // The response is populated into the response argument. Put(path string, body io.Reader, response interface{}) error - // Raw issues a request with type specified by method to the + // Request issues a request with type specified by method to the // specified path with the specified body. // The response is returned rather than being populated // into a response argument. - Raw(method string, path string, body io.Reader) (*http.Response, error) + Request(method string, path string, body io.Reader) (*http.Response, error) } // GQLClient is the interface that wraps methods for the different types of