Documentation ¶
Index ¶
- Variables
- type Curl
- func (curls *Curl) CreateRequest() (httpRequest *http.Request, err error)
- func (curls *Curl) Request(ctxs ...context.Context) (rs *Response, err error)
- func (curls *Curl) SetContext(ctx context.Context)
- func (curls *Curl) SetHeader(key, val string)
- func (curls *Curl) SetHeaders(headers map[string]string)
- func (curls *Curl) SetMethod(method string) error
- func (curls *Curl) SetOption(key string, val bool)
- func (curls *Curl) SetOptions(options map[string]bool)
- func (curls *Curl) SetStream()
- func (curls *Curl) SetTimeout(t int)
- func (curls *Curl) SetTimeoutMS(t int)
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRequestTimeout = errors.New("do request time out")
View Source
var ErrStopRedirect = errors.New("no redirects allowed")
Functions ¶
This section is empty.
Types ¶
type Curl ¶
type Curl struct {
Url, Method, Cookie, Referer string
Headers map[string]string
Options map[string]bool
RedirectCount int
//[]byte格式
PostBytes []byte
//string格式
PostString string
//key=>value格式
PostFields neturl.Values
PostFieldReaders map[string]io.Reader
//文件,key是字段名,val是文件路径
PostFiles neturl.Values
//流
PostReader io.Reader
// contains filtered or unexported fields
}
func (*Curl) CreateRequest ¶
func (*Curl) SetContext ¶
func (*Curl) SetHeaders ¶
func (*Curl) SetOptions ¶
Click to show internal directories.
Click to hide internal directories.