Documentation ¶
Index ¶
- Constants
- type Http
- func (obj *Http) DownloadFile(url, savePath string) (string, error)
- func (obj *Http) Get(url string, data map[string]interface{}, header map[string]string) ([]byte, error)
- func (*Http) GetUrlBody(url string) ([]byte, error)
- func (*Http) GetUrlRedirect(url string) (*url.URL, error)
- func (obj *Http) Post(url string, data map[string]interface{}, header map[string]string) ([]byte, error)
- func (obj *Http) Request(method, requestUrl string, data map[string]interface{}, ...) ([]byte, error)
- func (obj *Http) SetCookieJar(urlStr string, cookies []*http.Cookie) *Http
- func (obj *Http) SetProxyHttp(ip string, port int64) *Http
- func (obj *Http) SetProxySocks(ip string, port int64, name, password string) *Http
- type Net
Constants ¶
View Source
const ( POST = "POST" GET = "GET" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Http ¶
func (*Http) DownloadFile ¶
* 下载文件 url:下载地址 savePath:保存路径(包含文件名)
func (*Http) Get ¶
func (obj *Http) Get(url string, data map[string]interface{}, header map[string]string) ([]byte, error)
http get请求
func (*Http) GetUrlRedirect ¶
* 获取Url地址重写向地址
func (*Http) Post ¶
func (obj *Http) Post(url string, data map[string]interface{}, header map[string]string) ([]byte, error)
http post请求
func (*Http) Request ¶
func (obj *Http) Request(method, requestUrl string, data map[string]interface{}, header map[string]string) ([]byte, error)
http 通用请求
func (*Http) SetCookieJar ¶
设置cookie
func (*Http) SetProxyHttp ¶
设置Http代理 全局设置: os.Setenv("HTTP_PROXY", "http://127.0.0.1:9743") os.Setenv("HTTPS_PROXY", "https://127.0.0.1:9743")
Click to show internal directories.
Click to hide internal directories.