Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post "http:///api": http: no Host in request URL #30

Open
aep opened this issue Oct 31, 2020 · 1 comment
Open

Post "http:///api": http: no Host in request URL #30

aep opened this issue Oct 31, 2020 · 1 comment

Comments

@aep
Copy link

aep commented Oct 31, 2020

the create user example in README.md doesnt work for me. bridge.CreateUser fails with

Post "http:///api": http: no Host in request URL
@amimof
Copy link
Owner

amimof commented Nov 3, 2020

Hi @aep thanks for reporting. The example omits any errors that CreateUser may return. Try to see what those errors are by capturing them:

func main() {
  bridge, err := huego.Discover()
  if err != nil {
    panic(err)
  }
  user, err := bridge.CreateUser("my awesome hue app") // Link button needs to be pressed
  if err != nil {
    panic(err)
  }
  bridge = bridge.Login(user)
  light, err := bridge.GetLight(3)
  if err != nil {
    panic(err)
  }
  light.Off()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants