func (c *Client) Processes() (*pm.ProcResponse, error) {
	var result pm.ProcResponse
	if err := c.makeRequest("GET", "/procs/", nil, &result); err != nil {
		return nil, err
	}
	return &result, nil
}
Processes issues a GET to /proc, thus retrieving the full process list from
the server. The result is provided as a ProcResponse.
package client
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"github.com/VividCortex/pm"
)
type Client struct {
	*http.Client
	BaseURI string
	Headers map[string]string
}
func NewClient(uri string) *Client {
	return &Client{
		Client:  &http.Client{},
		BaseURI: uri,
		Headers: map[string]string{
			"Accept":       "application/json",
			"Content-Type": "application/json",
			"User-Agent":   "go-pm",
		},
	}
}
func (c *Client) makeRequest(verb, endpoint string, body, result interface{}) error {
	buf := new(bytes.Buffer)
	if body != nil {
		if err := json.NewEncoder(buf).Encode(body); err != nil {
			return err
		}
	}
	req, err := http.NewRequest(verb, c.BaseURI+endpoint, buf)
	if err != nil {
		return err
	}
	for header, value := range c.Headers {
		req.Header.Add(header, value)
	}
	resp, err := c.Do(req)
	if err == nil && resp.StatusCode > 299 {
		msg := fmt.Sprintf("HTTP Status Code %d from %s %s\n", resp.StatusCode, verb, c.BaseURI+endpoint)
		err = errors.New(msg)
	}
	if resp != nil {
		defer resp.Body.Close()
		if err == nil && result != nil {
			json.NewDecoder(resp.Body).Decode(result)
		}
	}
	return err
}