aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client.go')
-rw-r--r--client.go14
1 files changed, 10 insertions, 4 deletions
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,