restx

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAutoRedirectDisabled 是 resty 的哨兵错误,禁用重定向(NoRedirectPolicy)后收到重定向响应时返回。
	ErrAutoRedirectDisabled = resty.ErrAutoRedirectDisabled
	// ErrRateLimitExceeded 是 resty 的哨兵错误,通过 SetRateLimiter 设置的限流器拒绝请求时返回。
	ErrRateLimitExceeded = resty.ErrRateLimitExceeded
	// ErrResponseBodyTooLarge 是 resty 的哨兵错误,响应体超过 SetResponseBodyLimit 设置的上限时返回。
	ErrResponseBodyTooLarge = resty.ErrResponseBodyTooLarge
)

Functions

func New

func New() *resty.Client

New 创建带有统一默认配置的 resty 客户端。 客户端支持环境代理、HTTP/2、连接池和 Cookie Jar,请求总超时为五分钟。 调试模式下启用请求调试日志,resty 内部日志统一由 logx 输出。

Types

type Client added in v1.5.2

type Client = resty.Client

Client 是 resty.Client 的类型别名。

type Request

type Request = resty.Request

Request 是 resty.Request 的类型别名。

type Response added in v1.5.2

type Response = resty.Response

Response 是 resty.Response 的类型别名。

Jump to

Keyboard shortcuts

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