2019-02-13 13:05:59 +00:00
|
|
|
package koofrclient
|
|
|
|
|
|
|
|
import (
|
2019-08-14 13:56:32 +00:00
|
|
|
"github.com/koofr/go-httpclient"
|
2019-02-13 13:05:59 +00:00
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (c *KoofrClient) UserInfo() (user User, err error) {
|
|
|
|
request := httpclient.RequestData{
|
|
|
|
Method: "GET",
|
|
|
|
Path: "/api/v2/user",
|
|
|
|
ExpectedStatus: []int{http.StatusOK},
|
|
|
|
RespEncoding: httpclient.EncodingJSON,
|
|
|
|
RespValue: &user,
|
|
|
|
}
|
|
|
|
|
|
|
|
_, err = c.Request(&request)
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|