request

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) (b []byte, err error)

func MarshalAutoAssign

func MarshalAutoAssign(v interface{}) (b []byte, err error)

Types

type BaseRequest

type BaseRequest struct {
	SysID     string      `json:"sys_id"`
	ProductID string      `json:"product_id"`
	Sign      string      `json:"sign"`
	Data      interface{} `json:"data"`
	// contains filtered or unexported fields
}

func (*BaseRequest) Build

func (b *BaseRequest) Build() (req *http.Request, err error)

func (*BaseRequest) GetData

func (b *BaseRequest) GetData() interface{}

func (*BaseRequest) GetProductID

func (b *BaseRequest) GetProductID() string

func (*BaseRequest) GetSysID

func (b *BaseRequest) GetSysID() string

func (*BaseRequest) GetURL

func (b *BaseRequest) GetURL() string

func (*BaseRequest) SetData

func (b *BaseRequest) SetData(data interface{})

func (*BaseRequest) SetProductID

func (b *BaseRequest) SetProductID(pid string)

func (*BaseRequest) SetSign

func (b *BaseRequest) SetSign(sign string)

func (*BaseRequest) SetSysID

func (b *BaseRequest) SetSysID(sid string)

func (*BaseRequest) SetURL

func (b *BaseRequest) SetURL(url string)

type FileRequest

type FileRequest struct {
	*BaseRequest
	// contains filtered or unexported fields
}

func NewFileRequest

func NewFileRequest(url string, data interface{}) *FileRequest

func (*FileRequest) Build

func (f *FileRequest) Build() (req *http.Request, err error)

Build 构建http.Request https://paas.huifu.com/partners/api#/shgl/shjj/api_shjj_shtpsc?id=%e6%8e%a5%e5%8f%a3%e8%af%b4%e6%98%8e 最近更新时间:2024.3.1

func (*FileRequest) SetFile

func (f *FileRequest) SetFile(file io.Reader)

func (*FileRequest) StartWriteToBody

func (f *FileRequest) StartWriteToBody() error

type Request

type Request interface {
	SetURL(string)
	GetURL() string
	SetSysID(string)
	GetSysID() string
	SetProductID(string)
	GetProductID() string
	SetSign(string)
	SetData(interface{})
	GetData() interface{}
	Build() (*http.Request, error)
}

func New

func New(url string, data interface{}) Request

Jump to

Keyboard shortcuts

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