network

package
v0.0.0-...-9bd7499 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Post2Api

func Post2Api(url string, data interface{}, token string) (content []byte, err error)

application/json; charset=utf-8

func Post2ApiForRead

func Post2ApiForRead(url string, data interface{}, token string) (content []byte, err error)

func PostWithTimeOut

func PostWithTimeOut(url string, data interface{}, token string, timeout time.Duration) (content []byte, err error)

func Str2bytes

func Str2bytes(s string) []byte

Types

type HttpCli

type HttpCli struct {
	Error error
	// contains filtered or unexported fields
}

func Get

func Get(url string) *HttpCli

func Post

func Post(url string) *HttpCli

func (*HttpCli) BodyWithBytes

func (c *HttpCli) BodyWithBytes(buf []byte) *HttpCli

func (*HttpCli) BodyWithForm

func (c *HttpCli) BodyWithForm(form map[string]string) *HttpCli

func (*HttpCli) BodyWithJson

func (c *HttpCli) BodyWithJson(obj interface{}) *HttpCli

func (*HttpCli) SetHeader

func (c *HttpCli) SetHeader(key, value string) *HttpCli

func (*HttpCli) SetTimeOut

func (c *HttpCli) SetTimeOut(timeout time.Duration) *HttpCli

func (*HttpCli) ToBytes

func (c *HttpCli) ToBytes() (content []byte, err error)

func (*HttpCli) ToJson

func (c *HttpCli) ToJson(obj interface{}) error

Jump to

Keyboard shortcuts

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