request

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryReader added in v1.1.3

func BinaryReader(data []byte) *bytes.Reader

func DataReader added in v1.1.1

func DataReader(data any) io.Reader

func DoHttp

func DoHttp(url string, method string, data any, headers map[string]string) string

func DoHttpBase

func DoHttpBase(url string, method string, data any, headers map[string]string) (result io.ReadCloser)

func DoHttpGen

func DoHttpGen[T any](url string, method string, data any, headers map[string]string) T

func DownloadFile added in v1.1.3

func DownloadFile(url string, ext string) string

func FormReader added in v1.4.5

func FormReader(data url.Values) *bytes.Reader

func JsonReader added in v1.1.1

func JsonReader(data any) *bytes.Reader

func RequestMultiPart added in v1.1.3

func RequestMultiPart[T any](method, url string, fields []MultipartFormField) T

func StringReader added in v1.1.1

func StringReader(data string) *strings.Reader

Types

type GetRequest

type GetRequest struct {
	UrlValues url.Values
}

func (*GetRequest) AddParam

func (p *GetRequest) AddParam(property string, value string) *GetRequest

func (*GetRequest) BuildParams

func (p *GetRequest) BuildParams() string

func (*GetRequest) Init

func (p *GetRequest) Init() *GetRequest

func (*GetRequest) InitFrom

func (p *GetRequest) InitFrom(reqParams *GetRequest) *GetRequest

type MultipartFormField added in v1.1.8

type MultipartFormField struct {
	IsMedia bool
	Name    string
	Value   string
}

Jump to

Keyboard shortcuts

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