Documentation
¶
Index ¶
- func RequestSign(ts string, secret string) string
- type Request
- func (r *Request) Debug(debug ...bool) *Request
- func (r *Request) Delete(url string, params ...any) (*Response, error)
- func (r *Request) DisableKeepAlive(keep bool) *Request
- func (r *Request) Get(url string, params ...any) (*Response, error)
- func (r *Request) Json() *Request
- func (r *Request) Post(url string, params ...any) (*Response, error)
- func (r *Request) SetCookies(cookies map[string]string) *Request
- func (r *Request) SetHeaders(headers map[string]string) *Request
- func (r *Request) SetTimeOut(time time.Duration) *Request
- func (r *Request) SetTimeout(d time.Duration) *Request
- func (r *Request) SetTransport(v *http.Transport) *Request
- type Response
- func (r *Response) Body() ([]byte, error)
- func (r *Response) Close() error
- func (r *Response) Content() (string, error)
- func (r *Response) Cookies() []*http.Cookie
- func (r *Response) Headers() http.Header
- func (r *Response) Json(T any) error
- func (r *Response) JsonReturn(T any) (string, error)
- func (r *Response) Response() *http.Response
- func (r *Response) Result() (Result, error)
- func (r *Response) StatusCode() int
- func (r *Response) Time() string
- func (r *Response) Url() string
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestSign ¶
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest() *Request
func (*Request) DisableKeepAlive ¶
DisableKeepAlive 禁用长链接
func (*Request) SetCookies ¶
SetCookies 设置cookie
func (*Request) SetHeaders ¶
SetHeaders 设置请求的header
func (*Request) SetTimeout ¶
SetTimeout 设置超时时间
Click to show internal directories.
Click to hide internal directories.