httputil

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetMethod    = "GET"
	PostMethod   = "POST"
	SendtypeFrom = "from"
	SendtypeJson = "json"
)

Variables

This section is empty.

Functions

func GetUrlBuild

func GetUrlBuild(link string, data map[string]string) string

func JasonSend

func JasonSend(url string, method string, body interface{}) ([]byte, error)

func JasonSendWithHeader

func JasonSendWithHeader(url string, method string, body interface{}, header map[string]string) ([]byte, error)

Types

type HttpSend

type HttpSend struct {
	Link     string
	SendType string
	Header   map[string]string
	Body     interface{}
	Client   http.Client
	sync.RWMutex
}

func NewHttpSend

func NewHttpSend(link string) *HttpSend

func (*HttpSend) Get

func (h *HttpSend) Get() ([]byte, error)

func (*HttpSend) GetWithProxy

func (h *HttpSend) GetWithProxy(scheme, host string) ([]byte, error)

func (*HttpSend) Post

func (h *HttpSend) Post() ([]byte, error)

func (*HttpSend) PostWithProxy

func (h *HttpSend) PostWithProxy(scheme, host string) ([]byte, error)

func (*HttpSend) SetBody

func (h *HttpSend) SetBody(body interface{})

func (*HttpSend) SetHeader

func (h *HttpSend) SetHeader(header map[string]string)

func (*HttpSend) SetSendType

func (h *HttpSend) SetSendType(sendType string)

Jump to

Keyboard shortcuts

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