httpc package - github.com/dzlzh/httpc - Go Packages

httpc

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 7 Imported by: 2

README

httpc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(options ...ClientOption) *Client

func (*Client) SetClient

func (client *Client) SetClient(c *http.Client) *Client

func (*Client) SetProxy

func (client *Client) SetProxy(proxyUrl string) *Client

func (*Client) SetTimeout

func (client *Client) SetTimeout(t time.Duration) *Client

func (*Client) SetTransport

func (client *Client) SetTransport(tr *http.Transport) *Client

type ClientOption

type ClientOption func(*Client)

func Proxy

func Proxy(proxyUrl string) ClientOption

func Timeout

func Timeout(t time.Duration) ClientOption

type Request

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

func NewRequest

func NewRequest(c *Client) *Request

func (*Request) End

func (r *Request) End() (*http.Response, []byte, error)

func (*Request) Reset added in v0.1.3

func (r *Request) Reset() *Request

func (*Request) Send

func (r *Request) Send() *Request

func (*Request) SetBody added in v0.1.2

func (r *Request) SetBody(body io.Reader) *Request

func (*Request) SetCookies

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

func (*Request) SetDebug

func (r *Request) SetDebug(debug bool) *Request

func (*Request) SetForm added in v0.1.2

func (r *Request) SetForm(key, value string) *Request

func (*Request) SetHeader

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

func (*Request) SetHeaders

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

func (*Request) SetJson added in v0.1.2

func (r *Request) SetJson(json []byte) *Request

func (*Request) SetMethod

func (r *Request) SetMethod(method string) *Request

func (*Request) SetQuery

func (r *Request) SetQuery(key, value string) *Request

func (*Request) SetURL added in v0.1.1

func (r *Request) SetURL(url string) *Request

Jump to

Keyboard shortcuts

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