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: ? 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

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