Documentation
¶
Index ¶
- type HttpUtil
- func (c *HttpUtil) Close()
- func (c *HttpUtil) Get(url string) (string, error)
- func (c *HttpUtil) HttpBaseRequest(req *http.Request) ([]byte, *http.Response, error)
- func (c *HttpUtil) HttpRequest(method, url, queryString, contentType string) (string, error)
- func (c *HttpUtil) NewConnect(timeout int, proxy string) *http.Client
- func (c *HttpUtil) Post(url, queryString string) (string, error)
- func (c *HttpUtil) PostForm(url, queryString, form string) (string, error)
- func (c *HttpUtil) PostJson(url, queryString string) (string, error)
- func (c *HttpUtil) SetProxy(proxy string)
- type SessionCookieManager
- func (scm *SessionCookieManager) ClearCookies()
- func (cookieManager *SessionCookieManager) ParseCookieString(cookieString string)
- func (scm *SessionCookieManager) String() string
- func (scm *SessionCookieManager) Update(res *http.Response)
- func (scm *SessionCookieManager) UpdateFromResponseWithCallback(cookies []*http.Cookie, callback func(key, value string))
- func (scm *SessionCookieManager) UpdateWithCallback(res *http.Response, callback func(key, value string))
- func (scm *SessionCookieManager) Upsert(key, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpUtil ¶
type HttpUtil struct {
PoolSize int
CookieManager *SessionCookieManager
Redirect bool
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() *HttpUtil
func (*HttpUtil) HttpBaseRequest ¶
func (*HttpUtil) HttpRequest ¶
type SessionCookieManager ¶
func NewCookieManager ¶
func NewCookieManager() *SessionCookieManager
func (*SessionCookieManager) ClearCookies ¶ added in v0.0.11
func (scm *SessionCookieManager) ClearCookies()
func (*SessionCookieManager) ParseCookieString ¶
func (cookieManager *SessionCookieManager) ParseCookieString(cookieString string)
func (*SessionCookieManager) String ¶
func (scm *SessionCookieManager) String() string
cookie 键值 slice to string
func (*SessionCookieManager) Update ¶
func (scm *SessionCookieManager) Update(res *http.Response)
func (*SessionCookieManager) UpdateFromResponseWithCallback ¶ added in v0.0.11
func (scm *SessionCookieManager) UpdateFromResponseWithCallback(cookies []*http.Cookie, callback func(key, value string))
func (*SessionCookieManager) UpdateWithCallback ¶ added in v0.0.11
func (scm *SessionCookieManager) UpdateWithCallback(res *http.Response, callback func(key, value string))
根据响应里的cookie 更新cookie 从而达到维持session的目的
func (*SessionCookieManager) Upsert ¶
func (scm *SessionCookieManager) Upsert(key, value string)
有则更新 无则插入
Click to show internal directories.
Click to hide internal directories.