request

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Retry     int
	RetryWait int
	Timeout   int
	Proxy     string
	UserAgent string
	Debug     bool
)

Functions

func Get

func Get(uri string, body interface{}) error

func GetFile

func GetFile(uri string, file string) error

func GetString

func GetString(uri string) (string, error)

func GetWriter

func GetWriter(uri string, w io.Writer) error

func Init

func Init(opt *Options)

Types

type Options added in v0.6.5

type Options struct {
	UserAgent string
	Proxy     string // 使用代理
	Retry     int    // 额外重试次数,默认为不做重试
	RetryWait int    // 重试等待时间,最小3秒
	Timeout   int    // 超时时间,最小3秒
	Debug     bool
}

func (*Options) Default added in v0.6.5

func (o *Options) Default()

Jump to

Keyboard shortcuts

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