add standings subcommand
This commit is contained in:
@@ -42,6 +42,10 @@ func RequestContent(gamePk string) ([]byte, error) {
|
||||
return DefaultClient.RequestContent(gamePk)
|
||||
}
|
||||
|
||||
func RequestStandings(leagueId string) ([]byte, error) {
|
||||
return DefaultClient.RequestStandings(leagueId)
|
||||
}
|
||||
|
||||
type DiffPatchResponse []byte
|
||||
|
||||
type Client struct {
|
||||
@@ -108,6 +112,15 @@ func (c *Client) RequestContent(gamePk string) ([]byte, error) {
|
||||
return c.get(&endpoint)
|
||||
}
|
||||
|
||||
func (c *Client) RequestStandings(leagueId string) ([]byte, error) {
|
||||
endpoint := url.URL{Path: "api/v1/standings"}
|
||||
query := endpoint.Query()
|
||||
query.Add("leagueId", leagueId)
|
||||
endpoint.RawQuery = query.Encode()
|
||||
|
||||
return c.get(&endpoint)
|
||||
}
|
||||
|
||||
func (c *Client) get(endpoint *url.URL) ([]byte, error) {
|
||||
url := c.baseURL.ResolveReference(endpoint)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user