Documentation ¶
Index ¶
- Constants
- func NoBody() (contentType string, body io.Reader, err error)
- func NoProcess(*http.Response) error
- type Body
- type HeaderOption
- type Option
- type Process
- type ProcessMw
- type Request
- func (c *Request) BeforeProcess(mws ...ProcessMw) *Request
- func (c *Request) Body(body Body) *Request
- func (c *Request) Download(fn string) (err error)
- func (c *Request) Form(form url.Values) *Request
- func (c *Request) HeaderAdd(k string, vs ...string) *Request
- func (c *Request) HeaderDel(keys ...string) *Request
- func (c *Request) HeaderSet(k string, vs ...string) *Request
- func (c *Request) Method(method string) *Request
- func (c *Request) Process(process Process) error
- func (c *Request) ProcessBytes() (data []byte, err error)
- func (c *Request) Query(query string) *Request
- func (c *Request) TryAt(times ...time.Duration) *Request
- func (c *Request) Url(url string) *Request
- func (c *Request) UseClient(client *http.Client) *Request
- func (c *Request) With(options ...Option) *Request
Constants ¶
View Source
const ( HeaderAccept = "Accept" HeaderAcceptLanguage = "Accept-Language" HeaderAcceptEncoding = "Accept-Encoding" HeaderUserAgent = "User-Agent" HeaderContentType = "Content-Type" HeaderCacheControl = "Cache-Control" // no-cache HeaderPragma = "Pragma" // no-cache )
View Source
const ( MethodGet = http.MethodGet MethodHead = http.MethodHead MethodPost = http.MethodPost MethodPut = http.MethodPut MethodPatch = http.MethodPatch MethodDelete = http.MethodDelete MethodConnect = http.MethodConnect MethodOptions = http.MethodOptions MethodTrace = http.MethodTrace )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request 请求构造
func (*Request) BeforeProcess ¶
BeforeProcess 在处理之前的预处理
func (*Request) ProcessBytes ¶
ProcessBytes 处理响应字节
Click to show internal directories.
Click to hide internal directories.