Documentation ¶
Index ¶
- Constants
- Variables
- type Agent
- func (a *Agent) AddBearer(token string) *Agent
- func (a *Agent) AddCookie(c *http.Cookie) *Agent
- func (a *Agent) AddCookies(c []*http.Cookie) *Agent
- func (a *Agent) AppendHeader(param, value string) *Agent
- func (a *Agent) ClearAgent()
- func (a *Agent) ClearSendDataNow() *Agent
- func (a *Agent) Delete(url string) *Agent
- func (a *Agent) End(callback ...func(response Response, body string, errs []error)) (Response, string, []error)
- func (a *Agent) EndBytes(callback ...func(response Response, body []byte, errs []error)) (Response, []byte, []error)
- func (a *Agent) EndStruct(v interface{}, ...) (Response, []byte, []error)
- func (a *Agent) Get(url string) *Agent
- func (a *Agent) Head(url string) *Agent
- func (a *Agent) IgnoreTLSCheck() *Agent
- func (a *Agent) MakeRequest() (*http.Request, error)
- func (a *Agent) Options(url string) *Agent
- func (a *Agent) Param(key, value string) *Agent
- func (a *Agent) Patch(url string) *Agent
- func (a *Agent) Post(url string) *Agent
- func (a *Agent) ProcessReflectPointer(v reflect.Value, filename string, fieldname string, args []string) *Agent
- func (a *Agent) Proxy(proxyurl string) *Agent
- func (a *Agent) Put(url string) *Agent
- func (a *Agent) Query(content interface{}) *Agent
- func (a *Agent) Retry(count int, rTime time.Duration, codes ...int) *Agent
- func (a *Agent) Send(content interface{}) *Agent
- func (a *Agent) SendFile(file interface{}, args ...string) *Agent
- func (a *Agent) SendMap(content interface{}) *Agent
- func (a *Agent) SendRawBody() *Agent
- func (a *Agent) SendSlice(content []interface{}) *Agent
- func (a *Agent) SendString(content interface{}) *Agent
- func (a *Agent) SendStruct(content interface{}) *Agent
- func (a *Agent) SetBasicAuth(username, password string) *Agent
- func (a *Agent) SetClearSendDataBetweenSessions() *Agent
- func (a *Agent) SetDebug(enabled bool) *Agent
- func (a *Agent) SetDoNotClearBetweenSessions() *Agent
- func (a *Agent) SetHeader(param, value string) *Agent
- func (a *Agent) TLSClientConfig(config *tls.Config) *Agent
- func (a *Agent) Timeout(timeout time.Duration) *Agent
- func (a *Agent) Type(str string) *Agent
- type File
- type Request
- type Response
- type RetryType
Constants ¶
View Source
const ( POST = "POST" GET = "GET" HEAD = "HEAD" PUT = "PUT" DELETE = "DELETE" PATCH = "PATCH" OPTIONS = "OPTIONS" )
View Source
const ( TypeJSON = "json" TypeXML = "xml" TypeUrlencoded = "urlencoded" TypeForm = "form" TypeFormData = "form-data" TypeHTML = "html" TypeText = "text" TypeMultipart = "multipart" )
Variables ¶
View Source
var DisableTransportSwap bool
View Source
var Types = map[string]string{
TypeJSON: "application/json",
TypeXML: "application/xml",
TypeForm: "application/x-www-form-urlencoded",
TypeFormData: "application/x-www-form-urlencoded",
TypeUrlencoded: "application/x-www-form-urlencoded",
TypeHTML: "text/html",
TypeText: "text/plain",
TypeMultipart: "multipart/form-data",
}
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { BasicAuth struct{ Username, Password string } BounceToRawString bool ClearAgentData bool ClearSendData bool Client *http.Client Cookies []*http.Cookie Data map[string]interface{} Debug bool Errors []error FileData []File ForceType string FormData url.Values Header http.Header Method string QueryData url.Values RawString string Retryer *RetryType SliceData []interface{} TargetType string Transport *http.Transport URL string }
func (*Agent) AppendHeader ¶
func (*Agent) ClearAgent ¶
func (a *Agent) ClearAgent()
func (*Agent) ClearSendDataNow ¶
func (*Agent) IgnoreTLSCheck ¶
func (*Agent) ProcessReflectPointer ¶
func (*Agent) SendRawBody ¶
func (*Agent) SendString ¶
func (*Agent) SendStruct ¶
func (*Agent) SetBasicAuth ¶
func (*Agent) SetClearSendDataBetweenSessions ¶
func (*Agent) SetDoNotClearBetweenSessions ¶
Click to show internal directories.
Click to hide internal directories.