Documentation
¶
Index ¶
- type Reader
- type Writer
- func (w *Writer) Boundary() []byte
- func (w *Writer) Close() error
- func (w *Writer) CreateFormField(fieldname string, data []byte) error
- func (w *Writer) CreateFormFieldReader(fieldname string, data Reader) error
- func (w *Writer) CreateFormFile(fieldname string, filename string, data []byte) error
- func (w *Writer) CreateFormFileReader(fieldname string, filename string, data Reader) error
- func (w *Writer) FormDataContentType() string
- func (w *Writer) Len() int
- func (w *Writer) Read(dst []byte) (int, error)
- func (w *Writer) Reset()
- func (w *Writer) SetBoundary(boundary []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
A Writer generates multipart messages.
func NewWriter ¶
func NewWriter() *Writer
NewWriter returns a new multipart Writer with a random boundary.
func (*Writer) CreateFormField ¶
CreateFormField creates part with a header using the given field name and data.
func (*Writer) CreateFormFieldReader ¶
CreateFormFieldReader creates part with a header using the given field name and reader.
func (*Writer) CreateFormFile ¶
CreateFormFile creates a new form-data header with the provided field name and file name and data.
func (*Writer) CreateFormFileReader ¶
CreateFormFileReader creates a new form-data header with the provided field name and file name and reader.
func (*Writer) FormDataContentType ¶
FormDataContentType returns the Content-Type for an HTTP multipart/form-data with this Writer's Boundary.
func (*Writer) SetBoundary ¶
SetBoundary overrides the Writer's default randomly-generated boundary separator with an explicit value.
SetBoundary must be called before any parts are created, may only contain certain ASCII characters, and must be non-empty and at most 70 bytes long.