aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-10 21:56:54 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-10 21:56:54 +0100
commitc5aa119c91c26bb3cc64e1c43d13b3471f26cf94 (patch)
tree4d508a76e44df80d14a6c79ac586824a75c95615 /client.go
parenta0003616b6e76c85076253c83d19c49541c0e3e6 (diff)
Drop ioutil
Diffstat (limited to 'client.go')
-rw-r--r--client.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/client.go b/client.go
index 7a99592..f54148e 100644
--- a/client.go
+++ b/client.go
@@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"errors"
- "io/ioutil"
"log"
"net/http"
"net/textproto"
@@ -130,10 +129,12 @@ func (c *Client) Register(a *Account) error {
return err
}
defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return err
- }
- log.Println(string(body))
+ re := RegistrationResp{}
+ err = json.NewDecoder(resp.Body).Decode(&re)
+ log.Println(re)
+ return err
+}
+
+func (c *Client) Authorize(a *Account, d []string) error {
return nil
}