mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
21 lines
350 B
Go
21 lines
350 B
Go
package qbittorrent
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
)
|
|
|
|
func (c *Client) Version(ctx context.Context) (string, error) {
|
|
resp, err := c.doRequest(ctx, "GET", "/api/v2/app/version", nil, nil)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
defer resp.Body.Close()
|
|
|
|
body, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return string(body), nil
|
|
}
|