httpcli

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostFile

func PostFile(url, form_name, file_name, path string) (res *http.Response, err error)

通过HTTP上传文件 模拟<form ...><input name="file" type="file" />...</form> 参数说明 url: 上传服务器URL form_name: 对应<input>标签中的name file_name: 为form表单中的文件名 path: 为实际要上传的本地文件路径

Types

type Client

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

func NewClient

func NewClient() *Client

func NewProxyClient

func NewProxyClient(proxyURL *url.URL) *Client

func (*Client) IsExists

func (cli *Client) IsExists(Url string) bool

func (*Client) PostFile

func (cli *Client) PostFile(Url string, formName string, f *os.File) (*http.Response, error)

func (*Client) PostJSON

func (cli *Client) PostJSON(Url string, data interface{}) (*http.Response, error)

type CookieMap

type CookieMap map[string]*http.Cookie

func (CookieMap) GetValue

func (c CookieMap) GetValue(key string) string

type Jar

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

func (*Jar) Cookies

func (jar *Jar) Cookies(u *url.URL) []*http.Cookie

func (*Jar) SetCookies

func (jar *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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