diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-01-31 17:05:01 -0500 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-01-31 17:05:01 -0500 |
commit | d6a93a3bd5b0d7603847eb8029526343312e6945 (patch) | |
tree | 64d49beb8aabe310b4de49c2b6b9f0082e0545f1 | |
parent | 13b2a75e81e7ddf5724a37d8df5186031912cd5f (diff) |
Rough implementation for bridge.Get
-rw-r--r-- | bridge.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -37,6 +37,17 @@ type BridgeInfo struct { } `xml:"root"` } +func (self *Bridge) get(path string) (*http.Response, error) { + resp, err := http.Get("http://" + self.IPAddress + path) + if err != nil { + trace("", err) + return nil, err + } else if resp.StatusCode != 200 { + trace("Invalid bridge status.", nil) + } + return resp, nil +} + // Error Struct // http://www.developers.meethue.com/documentation/error-messages type Error struct { |