http

package
v0.0.0-...-e8513ac Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(url string, args map[string]string) (result string, err error)

func Post

func Post(url, contentType string, args map[string]string) (result string, err error)

Types

type Client

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

func NewClient

func NewClient() *Client

func NewHeaderClient

func NewHeaderClient(header *Header) *Client

func (*Client) Do

func (c *Client) Do(r *http.Request) (response *http.Response, err error)

func (*Client) Get

func (c *Client) Get(url string, values url.Values) (body []byte, statusCode int, err error)

func (*Client) Post

func (c *Client) Post(url string, values url.Values) (body []byte, statusCode int, err error)

func (*Client) PostData

func (c *Client) PostData(url string, values []byte) (body []byte, statusCode int, err error)

func (*Client) PostJSON

func (c *Client) PostJSON(url string, values interface{}) (body []byte, statusCode int, err error)

func (*Client) SetHeader

func (c *Client) SetHeader(header *Header)

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration)

func (*Client) SetTransport

func (c *Client) SetTransport(transport http.RoundTripper)
type Header map[string]string

func (Header) Get

func (h Header) Get(key string) string

func (Header) Set

func (h Header) Set(key, value string)

Jump to

Keyboard shortcuts

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