ihttp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FAST = iota
	STANDARD
)

Variables

View Source
var (
	DefaultMaxBodySize = 1024 * 100 // 100k
)
View Source
var MaxRedirects = 0

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(thread int, timeout int, clientType int) *Client

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *Request) (*Response, error)

func (*Client) FastDo

func (c *Client) FastDo(ctx context.Context, req *fasthttp.Request) (*fasthttp.Response, error)

func (*Client) StandardDo

func (c *Client) StandardDo(ctx context.Context, req *http.Request) (*http.Response, error)

type Request

type Request struct {
	StandardRequest *http.Request
	FastRequest     *fasthttp.Request
	ClientType      int
}

func (*Request) Host

func (r *Request) Host() string

func (*Request) URI

func (r *Request) URI() string

type Response

type Response struct {
	StandardResponse *http.Response
	FastResponse     *fasthttp.Response
	ClientType       int
}

func (*Response) Body

func (r *Response) Body() []byte

func (*Response) ContentLength

func (r *Response) ContentLength() int

func (*Response) GetHeader

func (r *Response) GetHeader(key string) string

func (*Response) Header

func (r *Response) Header() []byte

func (*Response) StatusCode

func (r *Response) StatusCode() int

Jump to

Keyboard shortcuts

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