requests

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request interface {
	// WAFRaw 原始请求
	WAFRaw() *http.Request

	// WAFRemoteIP 客户端IP
	WAFRemoteIP() string

	// WAFGetCacheBody 获取缓存中的Body
	WAFGetCacheBody() []byte

	// WAFSetCacheBody 设置Body
	WAFSetCacheBody(body []byte)

	// WAFReadBody 读取Body
	WAFReadBody(max int64) (data []byte, err error)

	// WAFRestoreBody 恢复Body
	WAFRestoreBody(data []byte)

	// WAFServerId 服务ID
	WAFServerId() int64

	// WAFClose 关闭当前请求所在的连接
	WAFClose()

	// WAFOnAction 动作回调
	WAFOnAction(action interface{}) (goNext bool)

	// WAFFingerprint 读取连接指纹
	WAFFingerprint() []byte

	// WAFMaxRequestSize 可以检查的最大内容尺寸
	WAFMaxRequestSize() int64

	// Format 格式化变量
	Format(string) string

	// ProcessResponseHeaders 处理响应Header
	ProcessResponseHeaders(headers http.Header, status int)

	// DisableAccessLog 在当前请求中不使用访问日志
	DisableAccessLog()
}

type Response

type Response struct {
	*http.Response

	BodyData []byte
}

func NewResponse

func NewResponse(resp *http.Response) *Response

type TestRequest

type TestRequest struct {
	BodyData []byte
	// contains filtered or unexported fields
}

func NewTestRequest

func NewTestRequest(raw *http.Request) *TestRequest

func (*TestRequest) DisableAccessLog added in v1.0.0

func (this *TestRequest) DisableAccessLog()

func (*TestRequest) Format

func (this *TestRequest) Format(s string) string

func (*TestRequest) ProcessResponseHeaders added in v1.2.7

func (this *TestRequest) ProcessResponseHeaders(headers http.Header, status int)

func (*TestRequest) WAFClose

func (this *TestRequest) WAFClose()

WAFClose 关闭当前请求所在的连接

func (*TestRequest) WAFFingerprint added in v1.0.0

func (this *TestRequest) WAFFingerprint() []byte

func (*TestRequest) WAFGetCacheBody

func (this *TestRequest) WAFGetCacheBody() []byte

func (*TestRequest) WAFMaxRequestSize added in v1.2.7

func (this *TestRequest) WAFMaxRequestSize() int64

func (*TestRequest) WAFOnAction

func (this *TestRequest) WAFOnAction(action interface{}) bool

func (*TestRequest) WAFRaw

func (this *TestRequest) WAFRaw() *http.Request

func (*TestRequest) WAFReadBody

func (this *TestRequest) WAFReadBody(max int64) (data []byte, err error)

func (*TestRequest) WAFRemoteAddr

func (this *TestRequest) WAFRemoteAddr() string

func (*TestRequest) WAFRemoteIP

func (this *TestRequest) WAFRemoteIP() string

func (*TestRequest) WAFRestoreBody

func (this *TestRequest) WAFRestoreBody(data []byte)

func (*TestRequest) WAFServerId

func (this *TestRequest) WAFServerId() int64

func (*TestRequest) WAFSetCacheBody

func (this *TestRequest) WAFSetCacheBody(bodyData []byte)

Jump to

Keyboard shortcuts

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