Add support for more key types
This commit is contained in:
parent
b1e4a0cf72
commit
001a4b4ac5
14 changed files with 98 additions and 48 deletions
|
@ -3,6 +3,7 @@ package client
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -37,7 +38,11 @@ func RegisterKey(baseUrl *url.URL, key string, userId string) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
|
||||
keyId := string(out[:])
|
||||
bodyContent := string(out[:])
|
||||
|
||||
return keyId, nil
|
||||
if resp.StatusCode >= 300 {
|
||||
return "", fmt.Errorf("bad status: %d - %s", resp.StatusCode, bodyContent)
|
||||
}
|
||||
|
||||
return bodyContent, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue