Documentation ¶
Index ¶
- Constants
- type Headers
- type Json
- type Method
- type Parser
- type Reader
- type Request
- func (p *Request) Copy() *Request
- func (p *Request) Delete(url string, params ...Reader) *Response
- func (p *Request) Exec() *Response
- func (p *Request) Get(url string, params ...Reader) *Response
- func (p *Request) Header() http.Header
- func (p *Request) Method() Method
- func (p *Request) Name() string
- func (p *Request) Origin() *http.Request
- func (p *Request) Params() []Reader
- func (p *Request) Post(url string, params ...Reader) *Response
- func (p *Request) Put(url string, params ...Reader) *Response
- func (p *Request) Send(method Method, url string, params ...Reader) (response *Response)
- func (p *Request) SetContentType(contentType string) *Request
- func (p *Request) SetFailedCallback(failedCallback func(response *Response)) *Request
- func (p *Request) SetHeader(key, value string) *Request
- func (p *Request) SetMethod(method Method) *Request
- func (p *Request) SetName(name string) *Request
- func (p *Request) SetParams(params []Reader) *Request
- func (p *Request) SetSuccessCallback(successCallback func(response *Response)) *Request
- func (p *Request) SetTimeout(timeout time.Duration) *Request
- func (p *Request) SetUrl(url string) *Request
- func (p *Request) Url() string
- type Response
- func (p *Response) Body() []byte
- func (p *Response) Code() int
- func (p *Response) Cost() time.Duration
- func (p *Response) Error() error
- func (p *Response) Header() http.Header
- func (p *Response) Json() (*_json.Json, error)
- func (p *Response) Name() string
- func (p *Response) Parse(parser Parser) (data interface{}, err error)
- func (p *Response) Request() *Request
- func (p *Response) Status() string
- func (p *Response) String() string
- type Responses
- type Scheduler
- func (p *Scheduler) Delete(url string, params ...Reader) *Response
- func (p *Scheduler) Parallel(requests ...*Request) *Responses
- func (p *Scheduler) Post(url string, params ...Reader) *Response
- func (p *Scheduler) Put(url string, params ...Reader) *Response
- func (p *Scheduler) Rand(requests ...*Request) *Response
- func (p *Scheduler) Send(method Method, url string, params ...Reader) (response *Response)
- func (p *Scheduler) Series(requests ...*Request) *Response
- func (p *Scheduler) SetContentType(contentType string)
- func (p *Scheduler) SetHeader(key, value string)
- func (p *Scheduler) SetHost(host string)
- type Status
Constants ¶
View Source
const ( CONTENT_TYPE = "Content-Type" JSON = "application/json" JSON_UTF8 = "application/json; charset=utf-8" X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded" FORM_DATA = "multipart/form-data" TEXT_XML = "text/xml" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Headers ¶
type Headers struct {
// contains filtered or unexported fields
}
func NewHeaders ¶
func NewHeaders() *Headers
type Parser ¶
func StatusDataParser ¶
func StatusDataParser(pointer interface{}) Parser
func StatusParser ¶
func StatusParser() Parser
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) SetContentType ¶
func (*Request) SetFailedCallback ¶
func (*Request) SetSuccessCallback ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse() *Response
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
func NewScheduler() *Scheduler
func (*Scheduler) SetContentType ¶
Click to show internal directories.
Click to hide internal directories.