aboutsummaryrefslogtreecommitdiff
path: root/bridge.go
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-04 13:50:28 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-04 13:50:28 -0500
commit89217de4c5384feec23342fdec4fe2b896cf559a (patch)
tree3bbf15e39e8afd2ac6c15db26cb0fb85b317816b /bridge.go
parent4a6869ee9c78f6c1496fefa35cd5b71afd1bd44d (diff)
Prepared SetLightState for bridge.Put
Diffstat (limited to 'bridge.go')
-rw-r--r--bridge.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/bridge.go b/bridge.go
index 7172289..7693599 100644
--- a/bridge.go
+++ b/bridge.go
@@ -2,7 +2,6 @@ package hue
import (
"log"
- "os"
"encoding/xml"
"encoding/json"
"net/http"
@@ -55,8 +54,8 @@ func (self *Bridge) Get(path string) ([]byte, io.Reader, error) {
}
// bridge.Post will send an http POST to the bridge with
-// a body formatted with parameters.
-func (self *Bridge) Post(path string, params map[string]string) ([]byte, io.Reader, error) {
+// a body formatted with parameters (in a generic interface)
+func (self *Bridge) Post(path string, params interface{}) ([]byte, io.Reader, error) {
// Add the params to the request
request, err := json.Marshal(params)
if err != nil {
@@ -83,6 +82,7 @@ func handleResponse(resp *http.Response) ([]byte, io.Reader, error) {
return []byte{}, nil, err
}
reader := bytes.NewReader(body)
+ log.Println("Handled request: ", string(body))
return body, reader, nil
}