requests

package
v0.0.0-...-58af531 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const UserAgent = "" /* 130-byte string literal not displayed */

UserAgent HTTP请求时使用的UA

Variables

View Source
var ErrOverSize = errors.New("oversize")

ErrOverSize 响应主体过大时返回此错误

Functions

This section is empty.

Types

type Request

type Request struct {
	Method string
	URL    string
	Header map[string]string
	Limit  int64
	Body   io.Reader
	// contains filtered or unexported fields
}

Request is a file download request

func (Request) Bytes

func (r Request) Bytes() ([]byte, error)

Bytes 对给定URL发送请求,返回响应主体

func (Request) JSON

func (r Request) JSON() (gjson.Result, error)

JSON 发送请求, 并转换响应为JSON

func (Request) WithTimeout

func (r Request) WithTimeout(t time.Duration) *Request

WithTimeout get a download instance with timeout t

Jump to

Keyboard shortcuts

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