From c5aa119c91c26bb3cc64e1c43d13b3471f26cf94 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 10 Dec 2015 21:56:54 +0100 Subject: Drop ioutil --- client.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'client.go') 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 } -- cgit v1.2.3