func (c *restClient) do(method, uri string, body []byte) (*http.Response, error) {
	rel, err := url.Parse(uri)
	if err != nil {
		return nil, err
	}
	url := c.baseURL.ResolveReference(rel)
	var r io.Reader
	if body != nil {
		r = bytes.NewReader(body)
	}
	req, err := http.NewRequest(method, url.String(), r)
	if err != nil {
		return nil, fmt.Errorf("%s for %q: %v", method, url, err)
	}
	return c.client.Do(req)
}
do performs an HTTP request with this client and returns the response.
package client
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
)
type httpClient interface {
	Do(*http.Request) (*http.Response, error)
}
type restClient struct {
	client  httpClient
	baseURL *url.URL
}