enamlbosh/api.go
func NewClient(user, pass, host string, port int, sslIgnore bool) (*Client, error) {
	c := &Client{
		user:      user,
		pass:      pass,
		host:      host,
		port:      port,
		sslIgnore: sslIgnore,
		http:      &http.Client{Transport: transport(sslIgnore)},
	}
	c.http.CheckRedirect = func(req *http.Request, via []*http.Request) error {
		req.URL, _ = url.Parse(req.URL.Scheme + "://" + via[0].URL.Host + req.URL.Path)
		setAuth(c, req)
		return nil
	}
	return c.setClientToken()
}
func NewClient(user, pass, host string, port int, sslIgnore bool) (*Client, error) {
	c := &Client{
		user:      user,
		pass:      pass,
		host:      host,
		port:      port,
		sslIgnore: sslIgnore,
		http:      &http.Client{Transport: transport(sslIgnore)},
	}
	c.http.CheckRedirect = func(req *http.Request, via []*http.Request) error {
		req.URL, _ = url.Parse(req.URL.Scheme + "://" + via[0].URL.Host + req.URL.Path)
		setAuth(c, req)
		return nil
	}
	return c.setClientToken()
}
// NewClient creates a new bosh client.  It queries bosh's /info endpoint
// to determine if user authentication should be done via UAA or basic auth.