rsapi/rsapi.go
func New(host string, auth Authenticator) *API {
	client := httpclient.New()
	if strings.HasPrefix(host, "http://") {
		host = host[7:]
	} else if strings.HasPrefix(host, "https://") {
		host = host[8:]
	}
	a := &API{
		Auth:   auth,
		Host:   host,
		Client: client,
	}
	if auth != nil {
		auth.SetHost(host)
	}
	return a
}
func New(host string, auth Authenticator) *API {
	client := httpclient.New()
	if strings.HasPrefix(host, "http://") {
		host = host[7:]
	} else if strings.HasPrefix(host, "https://") {
		host = host[8:]
	}
	a := &API{
		Auth:   auth,
		Host:   host,
		Client: client,
	}
	if auth != nil {
		auth.SetHost(host)
	}
	return a
}
// New returns a API client that uses the given authenticator.
// host may be blank in which case client attempts to resolve it using auth.