multipartForm

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* @Author: nijineko * @Date: 2024-08-30 16:37:03 * @LastEditTime: 2024-08-30 17:09:25 * @LastEditors: nijineko * @Description: 表单处理封装 * @FilePath: \yuzuhttp\request\multipartForm\multipartForm.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form struct {
	// contains filtered or unexported fields
}

Multipart表单结构

func New

func New() *Form

*

  • @description: 创建Multipart表单
  • @return {*multipartForm} Multipart表单

func (*Form) AddField

func (m *Form) AddField(Key, Value string) *Form

*

  • @description: 表单添加字段
  • @param {string} Key Key
  • @param {string} Value Value
  • @return {*multipartForm} Multipart表单

func (*Form) AddFile

func (m *Form) AddFile(Key string, Filename string, Value []byte) *Form

*

  • @description: 表单添加文件
  • @param {string} Key
  • @param {[]byte} Value
  • @param {string} Filename
  • @return {*}

func (*Form) BuildBody

func (m *Form) BuildBody() (*bytes.Buffer, string, error)

*

  • @description: 构建请求体
  • @return {*bytes.Buffer} 请求体

func (*Form) Get

func (m *Form) Get(Key string) []byte

*

  • @description: 获取表单数据
  • @param {string} Key Key
  • @return {[]byte} Value Value

func (*Form) GetBoundary

func (m *Form) GetBoundary() string

*

  • @description: 获取分隔符
  • @return {string} 分隔符

func (*Form) Remove

func (m *Form) Remove(Key string)

*

  • @description: 移除表单数据
  • @param {string} Key Key

func (*Form) SetBoundary

func (m *Form) SetBoundary(Boundary string) *Form

*

  • @description: 设置分隔符
  • @param {string} Boundary 分隔符
  • @return {*Form} Multipart表单

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL