network

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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