client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeepAlive

func KeepAlive(keepalive time.Duration)

func Proxy

func Proxy(url string)

func Timeout

func Timeout(timeout time.Duration)

func Transport

func Transport() *http.Transport

Types

type Client

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

func (*Client) Connect

func (h *Client) Connect(url string) *Request

func (*Client) Delete

func (h *Client) Delete(url string) *Request

func (*Client) Get

func (h *Client) Get(url string) *Request

func (*Client) Head

func (h *Client) Head(url string) *Request

func (*Client) Options

func (h *Client) Options(url string) *Request

func (*Client) Patch

func (h *Client) Patch(url string) *Request

func (*Client) Post

func (h *Client) Post(url string) *Request

func (*Client) Put

func (h *Client) Put(url string) *Request

func (*Client) Trace

func (h *Client) Trace(url string) *Request

type Form

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

func (*Form) Abort

func (p *Form) Abort()

func (*Form) Do

func (p *Form) Do() (*http.Response, error)

func (*Form) Send

func (p *Form) Send() *Response

type FormData

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

func (*FormData) Abort

func (p *FormData) Abort()

func (*FormData) Do

func (p *FormData) Do() (*http.Response, error)

func (*FormData) Send

func (p *FormData) Send() *Response

type Json

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

func (*Json) Abort

func (p *Json) Abort()

func (*Json) Do

func (p *Json) Do() (*http.Response, error)

func (*Json) Send

func (p *Json) Send() *Response

type OctetStream

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

func (*OctetStream) Abort

func (p *OctetStream) Abort()

func (*OctetStream) Do

func (p *OctetStream) Do() (*http.Response, error)

func (*OctetStream) Send

func (p *OctetStream) Send() *Response

type Progress

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

func (*Progress) OnProgress

func (p *Progress) OnProgress(fn func(p []byte, current int64, total int64)) *Progress

func (*Progress) Rate

func (p *Progress) Rate(rate float64) *Progress

Rate 0.01 - 100

type Protobuf

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

func (*Protobuf) Abort

func (p *Protobuf) Abort()

func (*Protobuf) Do

func (p *Protobuf) Do() (*http.Response, error)

func (*Protobuf) Send

func (p *Protobuf) Send() *Response

type Raw

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

func (*Raw) Abort

func (p *Raw) Abort()

func (*Raw) Do

func (p *Raw) Do() (*http.Response, error)

func (*Raw) Send

func (p *Raw) Send() *Response

type Request

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

func Delete

func Delete(url string) *Request

func Get

func Get(url string) *Request
func Head(url string) *Request

func Options

func Options(url string) *Request

func Patch

func Patch(url string) *Request

func Post

func Post(url string) *Request

func Put

func Put(url string) *Request

func Trace

func Trace(url string) *Request

func (*Request) AddCookie

func (h *Request) AddCookie(cookie *http.Cookie) *Request

func (*Request) AddHeader

func (h *Request) AddHeader(key string, value string) *Request

func (*Request) Form

func (h *Request) Form(body ...kitty.M) *Form

func (*Request) Json

func (h *Request) Json(body ...any) *Json

func (*Request) Multipart

func (h *Request) Multipart(body ...kitty.M) *FormData

func (*Request) OctetStream

func (h *Request) OctetStream(body io.Reader) *OctetStream

func (*Request) Progress

func (h *Request) Progress(progress *Progress) *Request

func (*Request) Protobuf

func (h *Request) Protobuf(body ...proto.Message) *Protobuf

func (*Request) Query

func (h *Request) Query(body ...kitty.M) *URL

func (*Request) Raw

func (h *Request) Raw(body io.Reader) *Raw

func (*Request) SetBasicAuth

func (h *Request) SetBasicAuth(userName, passWord string) *Request

func (*Request) SetCookies

func (h *Request) SetCookies(cookies []*http.Cookie) *Request

func (*Request) SetHeader

func (h *Request) SetHeader(key string, value string) *Request

func (*Request) SetHeaders

func (h *Request) SetHeaders(headers map[string]string) *Request

func (*Request) Timeout

func (h *Request) Timeout(timeout time.Duration) *Request

type Response

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

func (*Response) Bytes

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

func (*Response) Code

func (r *Response) Code() int

func (*Response) Error

func (r *Response) Error() error

func (*Response) Response

func (r *Response) Response() *http.Response

func (*Response) String

func (r *Response) String() string

type URL

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

func (*URL) Abort

func (p *URL) Abort()

func (*URL) Do

func (p *URL) Do() (*http.Response, error)

func (*URL) Send

func (p *URL) Send() *Response

Jump to

Keyboard shortcuts

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