Documentation ¶
Index ¶
- Constants
- type HttpUtil
- func (hUtil *HttpUtil) DownFile(urlStr string, _reqParm ...ReqParm) ([]byte, string)
- func (hUtil *HttpUtil) Get(urlStr string, _reqParm ...ReqParm) string
- func (hUtil *HttpUtil) GetBytes(urlStr string, reqParm ...ReqParm) []byte
- func (hUtil *HttpUtil) GetTransport() *http.Transport
- func (hUtil *HttpUtil) Head(urlStr string, postData []byte, _reqParm ...ReqParm) http.Header
- func (hUtil *HttpUtil) InitCookie()
- func (hUtil *HttpUtil) Post(urlStr string, postData url.Values, _reqParm ...ReqParm) string
- func (hUtil *HttpUtil) PostMap(urlStr string, postDataMap map[string]string, _reqParm ...ReqParm) string
- func (hUtil *HttpUtil) Req(method string, urlStr string, postData []byte, _reqParm ...ReqParm) []byte
- func (hUtil *HttpUtil) TimeoutDialer(cTimeout time.Duration, rwTimeout time.Duration) func(net, addr string) (c net.Conn, err error)
- type ReqParm
Constants ¶
View Source
const ( UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" Accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" AcceptEncoding = "gzip,deflate" AcceptLanguage = "zh-cn" AcceptCharset = "gb2312,utf-8;q=0.7,*;q=0.7" Timeout = 30 ContentType_xml = "application/xml" ContentType_json = "application/json" ContentType_multipar = "multipart/form-data" ContentType_form = "application/x-www-form-urlencoded" Method_GET = "GET" Method_POST = "POST" Method_PUT = "PUT" Method_PATCH = "PATCH" Method_DELETE = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpUtil ¶
type HttpUtil struct { UserAgent string Accept string AcceptEncoding string AcceptLanguage string AcceptCharset string Timeout time.Duration Headers map[string]string UseCookie bool CookieJar *cookiejar.Jar }
func NewDefaultHttpUtil ¶
func NewDefaultHttpUtil() HttpUtil
func NewHttpUtil ¶
func (*HttpUtil) GetTransport ¶
func (*HttpUtil) InitCookie ¶
func (hUtil *HttpUtil) InitCookie()
Click to show internal directories.
Click to hide internal directories.