func (options *PostForm) bindRequest(request *Request) error {
	request.PostForm = options
	return nil
}
RequestOption interface method, bind request option to request.
package direwolf
import (
	"net/http"
	"net/url"
	"sort"
	"strings"
	jsoniter "github.com/json-iterator/go"
)
type RequestOption interface {
	bindRequest(request *Request) error
}
type Body []byte
func (options Body) bindRequest(request *Request) error {
	request.Body = options
	return nil
}
type JsonBody []byte
func NewJsonBody(v interface{}) JsonBody {
	body, err := jsoniter.Marshal(v)
	if err != nil {
		return nil
	}
	return body
}
func (options JsonBody) bindRequest(request *Request) error {
	request.Body = options
	return nil
}
type RedirectNum int
func (options RedirectNum) bindRequest(request *Request) error {
	request.RedirectNum = int(options)
	return nil
}
type Timeout int
func (options Timeout) bindRequest(request *Request) error {
	request.Timeout = int(options)
	return nil
}
type Proxy struct {
	HTTP  string
	HTTPS string
}
func (options *Proxy) bindRequest(request *Request) error {
	request.Proxy = options
	return nil
}
type strSliceMap struct {
	data map[string][]string
}
func (ssm *strSliceMap) New(keyValue ...string) {
	ssm.data = make(map[string][]string)
	if keyValue != nil {
		if len(keyValue)%2 != 0 {
			panic("key and value must be pair")
		}
		for i := 0; i < len(keyValue)/2; i++ {
			key := keyValue[i*2]
			value := keyValue[i*2+1]
			ssm.data[key] = append(ssm.data[key], value)
		}
	}
}
func (ssm *strSliceMap) Add(key, value string) {
	ssm.data[key] = append(ssm.data[key], value)
}
func (ssm *strSliceMap) Set(key, value string) {
	ssm.data[key] = []string{value}
}
func (ssm *strSliceMap) Del(key string) {
	delete(ssm.data, key)
}
func (ssm *strSliceMap) Get(key string, index ...int) string {
	if ssm.data == nil {
		return ""
	}
	ssmValue := ssm.data[key]
	if len(ssmValue) == 0 {
		return ""
	}
	if index != nil {
		return ssmValue[index[0]]
	}
	return ssmValue[0]
}
func (ssm *strSliceMap) URLEncode() string {
	if ssm.data == nil {
		return ""
	}
	var buf strings.Builder
	keys := make([]string, 0, len(ssm.data))
	for k := range ssm.data {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	for _, k := range keys {
		ssmValue := ssm.data[k]
		keyEscaped := url.QueryEscape(k)
		for _, v := range ssmValue {
			if buf.Len() > 0 {
				buf.WriteByte('&')
			}
			buf.WriteString(keyEscaped)
			buf.WriteByte('=')
			buf.WriteString(url.QueryEscape(v))
		}
	}
	return buf.String()
}
type Params struct {
	strSliceMap
}
func NewParams(keyValue ...string) *Params {
	var p = &Params{}
	p.New(keyValue...)
	return p
}
func (options *Params) bindRequest(request *Request) error {
	request.Params = options
	u, err := url.Parse(request.URL)
	if err != nil {
		return WrapErrf(err, "URL error")
	}
	if u.RawQuery == "" && u.ForceQuery == false {
		request.URL = request.URL + "?" + request.Params.URLEncode()
	} else if u.RawQuery == "" && u.ForceQuery == true {
		request.URL = request.URL + request.Params.URLEncode()
	} else {
		request.URL = request.URL + "&" + request.Params.URLEncode()
	}
	return nil
}
type PostForm struct {
	strSliceMap
}
func NewPostForm(keyValue ...string) *PostForm {
	var p = &PostForm{}
	p.New(keyValue...)
	return p
}