From 9afc7bda5c1ce76ade2bfd0c91e1bd1cbbceeb44 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 18 Dec 2015 00:38:36 +0100 Subject: 409 --- client.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index 83dcf57..0b6a892 100644 --- a/client.go +++ b/client.go @@ -88,14 +88,14 @@ func (c *Client) post(url string, s Signer, v interface{}) error { } defer resp.Body.Close() - if resp.StatusCode >= http.StatusBadRequest { - return handleError(resp) - } - c.nonce <- replyNonce(resp) c.Link = links(resp) c.Location = location(resp) + if resp.StatusCode >= http.StatusBadRequest { + return handleError(resp) + } + body, err = ioutil.ReadAll(resp.Body) if err != nil { return err @@ -173,6 +173,12 @@ func (c *Client) Agree(a *Account) (*Registration, error) { return r, err } +func (c *Client) Query(a *Account) (*Registration, error) { + r := &Registration{Resource: ResRegister} + err := c.post(c.Location, a, r) + return r, err +} + func (c *Client) Authorize(a *Account, domain string) (*Authorization, error) { r := &Authorization{ Resource: ResNewAuthz, -- cgit v1.2.3