Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Request
- func Delete(originUrl string) (*Request, error)
- func Download(filepath, originUrl string) (*Request, error)
- func Get(originUrl string, params map[string]string) (*Request, error)
- func NewRequest(config *Config) *Request
- func NewSession(config *Config) *Request
- func Post(originUrl string, data map[string]interface{}) (*Request, error)
- func PostForm(originUrl string, data map[string]string) (*Request, error)
- func Put(originUrl string, data map[string]interface{}) (*Request, error)
- func Session() *Request
- func (r *Request) Delete(originUrl string) error
- func (r *Request) Download(filePath, originUrl string) error
- func (r *Request) Get(originUrl string, params map[string]string) error
- func (r *Request) ParseUrl(originUrl string) error
- func (r *Request) Post(originUrl string, data map[string]interface{}) error
- func (r *Request) PostForm(originUrl string, data map[string]string) error
- func (r *Request) Put(originUrl string, data map[string]interface{}) error
- func (r *Request) SetBasicAuth(username, password string)
- func (r *Request) SetBearerTokenAuth(token string)
- func (r *Request) SetHeader(headers map[string]string)
- func (r Request) SetProxy(proxy map[string]string)
- func (r *Request) SetTimeout(t time.Duration)
- func (r *Request) SkipTLSVerify()
Constants ¶
Variables ¶
View Source
var DefaultConfig = &Config{Timeout: 10 * time.Second}
Functions ¶
This section is empty.
Types ¶
type Request ¶ added in v1.0.2
type Request struct { Req *http.Request Client *http.Client Resp *http.Response Content string StatusCode int Status string }
func NewRequest ¶ added in v1.0.2
func NewSession ¶
func (*Request) SetBasicAuth ¶ added in v1.0.3
func (*Request) SetBearerTokenAuth ¶ added in v1.0.3
func (*Request) SetTimeout ¶ added in v1.0.3
func (*Request) SkipTLSVerify ¶ added in v1.0.3
func (r *Request) SkipTLSVerify()
Click to show internal directories.
Click to hide internal directories.