Documentation ¶
Index ¶
- Constants
- type Requests
- func (r *Requests) AddCookie(key, value string) *Requests
- func (r *Requests) AddCookies(param map[string]string) *Requests
- func (r *Requests) AddHeader(key, value string) *Requests
- func (r *Requests) AddHeaders(param map[string]string) *Requests
- func (r *Requests) AddParam(key, value string) *Requests
- func (r *Requests) AddParams(param map[string]string) *Requests
- func (r *Requests) BasicAuth(user, password string) *Requests
- func (r *Requests) Proxy(proxy string) *Requests
- func (r *Requests) ReadText() string
- func (r *Requests) RemoveCookies(key string) *Requests
- func (r *Requests) Send() *Requests
- func (r *Requests) SetConnTimeOut(time int) *Requests
- func (r *Requests) SetContentType(contentType string) *Requests
- func (r *Requests) SetRespTimeOut(time int) *Requests
- func (r *Requests) SetTimeOut(time int) *Requests
- func (r *Requests) WriteToFile(path string)
- type Sessions
- func (s *Sessions) AddHeader(key, value string) *Sessions
- func (s *Sessions) AddHeaders(param map[string]string) *Sessions
- func (s *Sessions) BasicAuth(user, password string) *Sessions
- func (s *Sessions) Get(uri string) *Requests
- func (s *Sessions) Post(uri string) *Requests
- func (s *Sessions) Proxy(proxy string) *Sessions
Constants ¶
View Source
const ( GET requestType = "GET" POST requestType = "POST" )
View Source
const ( HeaderContentType = "Content-Type" HeaderAuthorization = "Authorization" HeaderCookie = "Cookie" )
枚举, 固定请求头
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Requests ¶
type Requests struct {
// contains filtered or unexported fields
}
func (*Requests) AddCookies ¶
增加多个Cookie参数
func (*Requests) AddHeaders ¶
增加多个请求头参数
func (*Requests) RemoveCookies ¶
删除一个cookie信息
func (*Requests) SetContentType ¶
设置请求头中的content type
Click to show internal directories.
Click to hide internal directories.