requests

package module
v0.0.0-...-55e5bf4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 22 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

View Source
const (
	DEFAULT_REDIRECT_LIMIT = 30 // 默认redirect最大次数
	DEFAULT_TIMEOUT        = 10 // 默认client响应时间
)
View Source
const (
	NAME       = "golang-requests" // 名称
	VERSION    = "1.2.4"           // 当前版本
	USER_AGENT = NAME + VERSION    // UA
)

Variables

This section is empty.

Functions

func Connect

func Connect(rawurl string, req *url.Request) (*models.Response, error)

func DecompressBody

func DecompressBody(content *[]byte, encoding string)

解码Body数据

func Delete

func Delete(rawurl string, req *url.Request) (*models.Response, error)

func Get

func Get(rawurl string, req *url.Request) (*models.Response, error)
func Head(rawurl string, req *url.Request) (*models.Response, error)

func Options

func Options(rawurl string, req *url.Request) (*models.Response, error)

func Patch

func Patch(rawurl string, req *url.Request) (*models.Response, error)

func Post

func Post(rawurl string, req *url.Request) (*models.Response, error)

func Put

func Put(rawurl string, req *url.Request) (*models.Response, error)

func Request

func Request(method, rawurl string, req *url.Request) (*models.Response, error)

func Trace

func Trace(rawurl string, req *url.Request) (*models.Response, error)

Types

type Session

type Session struct {
	Params        *url.Params
	Headers       *http.Header
	Cookies       *cookiejar.Jar
	Auth          []string
	Proxies       string
	Verify        bool
	Cert          []string
	Ja3           string
	MaxRedirects  int
	TLSExtensions *ja3.TLSExtensions
	HTTP2Settings *http2.HTTP2Settings
	// contains filtered or unexported fields
}

Session结构体

func DefaultSession

func DefaultSession() *Session

新建默认Session,同上一模一样

func NewSession

func NewSession() *Session

新建默认Session

func (*Session) Connect

func (s *Session) Connect(rawurl string, req *url.Request) (*models.Response, error)

connect请求方式

func (*Session) Delete

func (s *Session) Delete(rawurl string, req *url.Request) (*models.Response, error)

delete请求方式

func (*Session) Get

func (s *Session) Get(rawurl string, req *url.Request) (*models.Response, error)

get请求方式

func (*Session) Head

func (s *Session) Head(rawurl string, req *url.Request) (*models.Response, error)

head请求方式

func (*Session) Options

func (s *Session) Options(rawurl string, req *url.Request) (*models.Response, error)

options请求方式

func (*Session) Patch

func (s *Session) Patch(rawurl string, req *url.Request) (*models.Response, error)

patch请求方式

func (*Session) Post

func (s *Session) Post(rawurl string, req *url.Request) (*models.Response, error)

post请求方式

func (*Session) Prepare_request

func (s *Session) Prepare_request(request *models.Request) (*models.PrepareRequest, error)

预请求处理

func (*Session) Put

func (s *Session) Put(rawurl string, req *url.Request) (*models.Response, error)

put请求方式

func (*Session) Request

func (s *Session) Request(method, rawurl string, request *url.Request) (*models.Response, error)

http请求方式基础函数

func (*Session) Send

func (s *Session) Send(preq *models.PrepareRequest, req *url.Request) (*models.Response, error)

发送数据

func (*Session) Trace

func (s *Session) Trace(rawurl string, req *url.Request) (*models.Response, error)

trace请求方式

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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