func (acc *Account) parseCookies(resp *http.Response) {
	if acc.client.Jar != nil {
		if cookies := readSetCookies(resp.Header); len(cookies) > 0 {
			acc.client.Jar.SetCookies(resp.Request.URL, cookies)
		}
	}
}
parseCookies parses cookies of a given header.
The parser is a bit more relaxed than go's default cookie parser.
package api
import (
	"net/http"
	"net/url"
	"strconv"
	"strings"
	"time"
	"golang.org/x/net/http/httpguts"
)
func (acc *Account) SetClient(client *http.Client) {
	acc.client = client
}
func (acc *Account) SetTransport(trans *http.Transport) {
	acc.client.Transport = trans
}
func (acc *Account) SetTimeout(timeout time.Duration) {
	acc.client.Timeout = timeout
}
func (acc *Account) DoFormRequest(data url.Values) (*http.Response, error) {
	req, err := http.NewRequest("POST", apiURL, strings.NewReader(data.Encode()))
	if err != nil {
		return nil, err
	}
	req.Header.Add("content-type", "application/x-www-form-urlencoded")
	req.Header.Add("referer", referer)
	req.Header.Add("origin", origin)
	return acc.DoRequest(req)
}
func (acc *Account) DoRequest(req *http.Request) (*http.Response, error) {
	res, err := acc.client.Do(req)
	if err != nil {
		return res, err
	}
	acc.parseCookies(res)
	return res, err
}