func NewMultipartPartBytes(name string, body []byte, contentType ...string) *MultipartPart {
	return NewMultipartPart(name, bytes.NewReader(body), contentType...)
}
NewMultipartPartBytes returns a new *MultipartPart based on "body" content.
package tdhttp
import (
	"bytes"
	"io"
	"net/http"
	"os"
	"path/filepath"
	"strings"
)
const (
	defaultMediaType = "multipart/form-data"
	defaultBoundary  = "go-testdeep-42"
)
type MultipartBody struct {
	MediaType string            
	Boundary  string            
	Parts     []*MultipartPart  
	content   io.Reader
}
func (b *MultipartBody) Read(p []byte) (n int, err error) {
	if b.content == nil {
		if b.Boundary == "" {
			b.Boundary = defaultBoundary
		}
		between := []byte("\r\n--" + b.Boundary + "\r\n")
		first := between[2:]
		end := []byte("\r\n--" + b.Boundary + "--\r\n")
		readers := make([]io.Reader, 0, len(b.Parts)*2+3)
		readers = append(readers, bytes.NewReader(first))
		for i, part := range b.Parts {
			if i > 0 {
				readers = append(readers, bytes.NewReader(between))
			}
			readers = append(readers, part)
		}
		readers = append(readers, bytes.NewReader(end))
		b.content = io.MultiReader(readers...)
	}
	return b.content.Read(p)
}
func (b *MultipartBody) ContentType() string {
	mt := b.MediaType
	if mt == "" {
		mt = defaultMediaType
	}
	if b.Boundary == "" {
		b.Boundary = defaultBoundary
	}
	return mt + `; boundary="` + b.Boundary + `"`
}
type MultipartPart struct {
	Name       string       
	Filename   string       
	Content    io.Reader    
	Header     http.Header  
	headerDone bool
}
func NewMultipartPart(name string, body io.Reader, contentType ...string) *MultipartPart {
	p := MultipartPart{
		Name:    name,
		Content: body,
	}
	if len(contentType) > 0 {
		p.Header = http.Header{"Content-Type": contentType[:1]}
	}
	return &p
}
func NewMultipartPartFile(name string, filePath string, contentType ...string) *MultipartPart {
	p := NewMultipartPart(name, &fileReader{filePath: filePath}, contentType...)
	p.Filename = filepath.Base(filePath)
	return p
}
func NewMultipartPartString(name string, body string, contentType ...string) *MultipartPart {
	return NewMultipartPart(name, strings.NewReader(body), contentType...)
}