func (m *JSONMarshaler) Marshal(v interface{}) (data []byte, contentType string, err error) {
	if m.Indent {
		data, err = json.MarshalIndent(v, "", "  ")
	} else {
		data, err = json.Marshal(v)
	}
	return data, contentTypeJSON, merry.Wrap(err)
}
Marshal implements Marshaler.
package requester
import (
	"encoding/json"
	"encoding/xml"
	"github.com/ansel1/merry"
	goquery "github.com/google/go-querystring/query"
	"mime"
	"net/url"
	"strings"
)
var DefaultMarshaler Marshaler = &JSONMarshaler{}
var DefaultUnmarshaler Unmarshaler = NewContentTypeUnmarshaler()
const (
	contentTypeForm = MediaTypeForm + "; charset=UTF-8"
	contentTypeXML  = MediaTypeXML + "; charset=UTF-8"
	contentTypeJSON = MediaTypeJSON + "; charset=UTF-8"
)
type Marshaler interface {
	Marshal(v interface{}) (data []byte, contentType string, err error)
}
type Unmarshaler interface {
	Unmarshal(data []byte, contentType string, v interface{}) error
}
type MarshalFunc func(v interface{}) ([]byte, string, error)
func (f MarshalFunc) Apply(r *Requester) error {
	r.Marshaler = f
	return nil
}
func (f MarshalFunc) Marshal(v interface{}) ([]byte, string, error) {
	return f(v)
}
type UnmarshalFunc func(data []byte, contentType string, v interface{}) error
func (f UnmarshalFunc) Apply(r *Requester) error {
	r.Unmarshaler = f
	return nil
}
func (f UnmarshalFunc) Unmarshal(data []byte, contentType string, v interface{}) error {
	return f(data, contentType, v)
}
type JSONMarshaler struct {
	Indent bool
}
func (m *JSONMarshaler) Unmarshal(data []byte, contentType string, v interface{}) error {
	return merry.Wrap(json.Unmarshal(data, v))
}