Slide 19
Slide 19 text
package dnsimple
import (
"encoding/json"
"github.com/google/go-querystring/query"
)
const libraryVersion = "0.13.0"
type Client struct {
HttpClient *http.Client
Credentials Credentials
}
func (c *Client) get(path string, obj interface{}) (*http.Response, error) {
req, err := c.NewRequest("GET", path, nil)
if err != nil {
return nil, err
}
return c.Do(req, obj)
}
func (c *Client) post(path string, payload, obj interface{}) (*http.Response, error) {
req, err := c.NewRequest("POST", path, payload)
if err != nil {
return nil, err
}
return c.Do(req, obj)
}