requests

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeoutOption = TimeoutOption(time.Second * 5)

Functions

This section is empty.

Types

type Option

type Option func(*requests.Request)

func AddUAOption added in v0.0.7

func AddUAOption() Option

func CookieOption

func CookieOption(name string, value string) Option

func DebugOption

func DebugOption() Option

func DisableTlsOption

func DisableTlsOption() Option

func HeaderOption

func HeaderOption(key, value string) Option

func HttpCookieOption

func HttpCookieOption(cookie *http.Cookie) Option

func ProxyOption

func ProxyOption(prefer proxy_pool.Prefer) Option

func TimeoutOption

func TimeoutOption(d time.Duration) Option

type ResponseWithProxy

type ResponseWithProxy struct {
	*requests.Response
	Proxy string
}

func Get

func Get(ctx context.Context, url string, params requests.Params, maxRetry int, options ...Option) (*ResponseWithProxy, error)

func Post

func Post(ctx context.Context, url string, form requests.Datas, maxRetry int, options ...Option) (*ResponseWithProxy, error)

func PostJson

func PostJson(ctx context.Context, url string, params interface{}, maxRetry int, options ...Option) (*ResponseWithProxy, error)

Jump to

Keyboard shortcuts

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