func (base Client) signQuery(params Values) Values {
	params.Set("SellerId", base.SellerId)
	if base.AuthToken != "" {
		params.Set("MWSAuthToken", base.AuthToken)
	}
	params.Set("SignatureMethod", base.SignatureMethod())
	params.Set("SignatureVersion", base.SignatureVersion())
	params.Set("AWSAccessKeyId", base.accessKey)
	params.Set("Version", base.Version)
	params.Set("Timestamp", now())
	signature := base.generateSignature(params)
	params.Set("Signature", signature)
	return params
}
signQuery generate the signature and add the signature to the http parameters.
package mws
import (
	"bytes"
	"fmt"
	"net/http"
	"net/url"
	"strconv"
	"strings"
)
type Values struct {
	url.Values
}
func NewValues() Values {
	return Values{url.Values{}}
}
func (params Values) Encode() string {
	return strings.Replace(params.Values.Encode(), "+", "%20", -1)
}
type Client struct {
	Host string
	Region string
	MarketPlaceId string
	Version string
	Name string
	SellerId string
	AuthToken string
	accessKey string
	secretKey string
	*http.Client
}
func NewClient(config Config, version, name string) (*Client, error) {
	if config.SellerId == "" {
		return nil, fmt.Errorf("No seller id provided")
	}
	region := config.Region
	if region == "" {
		region = "US"
	}
	marketPlace, mError := NewMarketPlace(region)
	if mError != nil {
		return nil, mError
	}
	credential := config.Credential()
	if credential.AccessKey == "" || credential.SecretKey == "" {
		return nil, fmt.Errorf("Can't find mws credential information")
	}
	base := Client{
		SellerId:      config.SellerId,
		AuthToken:     config.AuthToken,
		Region:        region,
		MarketPlaceId: marketPlace.Id,
		Host:          marketPlace.EndPoint,
		Version:       version,
		Name:          name,
		accessKey:     credential.AccessKey,
		secretKey:     credential.SecretKey,
		Client:        new(http.Client),
	}
	return &base, nil
}
func (base Client) Path() string {
	path := ""
	if base.Name != "" {
		path += "/" + base.Name
	}
	if base.Version != "" {
		path += "/" + base.Version
	}
	return path
}
func (base Client) EndPoint() string {
	return "https://" + base.Host + base.Path()
}
func (base Client) SignatureMethod() string {
	return "HmacSHA256"
}
func (base Client) SignatureVersion() string {
	return "2"
}
func (base Client) SendRequest(structuredParams Parameters) (*Response, error) {
	request, err := base.buildRequest(structuredParams)
	if err != nil {
		return nil, err
	}
	resp, err := base.Client.Do(request)
	if err != nil {
		return nil, err
	}
	return NewResponse(resp), nil
}
func (base Client) buildRequest(structuredParams Parameters) (*http.Request, error) {
	params, err := structuredParams.Normalize()
	if err != nil {
		return nil, err
	}
	encodedParams := base.signQuery(params).Encode()
	req, err := http.NewRequest(
		"POST",
		base.EndPoint(),
		bytes.NewBufferString(encodedParams),
	)
	if err != nil {
		return nil, err
	}
	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
	req.Header.Add("Content-Length", strconv.Itoa(len(encodedParams)))
	return req, nil
}