Do performs an http.Request and optionally parses the response body into the given interface.
(req *http.Request)
| 63 | |
| 64 | // Do performs an http.Request and optionally parses the response body into the given interface. |
| 65 | func (c *Client) Do(req *http.Request) (*http.Response, error) { |
| 66 | debug.DumpRequest(req) |
| 67 | |
| 68 | res, err := c.Client.Do(req) |
| 69 | if err != nil { |
| 70 | return nil, err |
| 71 | } |
| 72 | |
| 73 | debug.DumpResponse(res) |
| 74 | return res, nil |
| 75 | } |
| 76 | |
| 77 | // TokenIsValid calls the API to determine whether the token is valid. |
| 78 | func (c *Client) TokenIsValid() (bool, error) { |