Documentation ¶
Index ¶
- Constants
- Variables
- func CustomDialContext(dnsResolver string) func(ctx context.Context, network, address string) (net.Conn, error)
- func HeaderFilterFlags(content string) string
- func NewDefaultHeader() http.Header
- type AuthType
- type Client
- func (c *Client) Clone() *Client
- func (c *Client) Delete(path string) *Request
- func (c *Client) Get(path string) *Request
- func (c *Client) Group(urlPath string) *Client
- func (c *Client) Method(verb Method) *Request
- func (c *Client) Patch(path string) *Request
- func (c *Client) Post(path string) *Request
- func (c *Client) Put(path string) *Request
- func (c *Client) SetBaseURL(u string) *Client
- func (c *Client) SetBasicAuth(username, password string) *Client
- func (c *Client) SetBearerTokenAuth(token string) *Client
- func (c *Client) SetCarryCookies() *Client
- func (c *Client) SetCarryQueryParameters(severity Severity) *Client
- func (c *Client) SetCert(caPath, clientCrtPath, clientKeyPath string) *Client
- func (c *Client) SetContentType(contentType string) *Client
- func (c *Client) SetCookie(cs ...*http.Cookie) *Client
- func (c *Client) SetDNS(dnsResolver string) *Client
- func (c *Client) SetHeader(key string, values ...string) *Client
- func (c *Client) SetIgnoreCert() *Client
- func (c *Client) SetLogDirPath(path string) *Client
- func (c *Client) SetLogLevel(l logger.Level) *Client
- func (c *Client) SetLogSaveFile(s bool) *Client
- func (c *Client) SetMinVersionTLS(tlsVersion uint16) *Client
- func (c *Client) SetNoAutoRedirect() *Client
- func (c *Client) SetProxyAdd(add string) *Client
- func (c *Client) SetProxyPort(port int) *Client
- func (c *Client) SetProxyScheme(scheme string) *Client
- func (c *Client) SetProxyUrl(u string) *Client
- func (c *Client) SetTimeout(t time.Duration) *Client
- func (c *Client) SetUserAgent(user_agent string) *Client
- type Method
- type Request
- func (r *Request) AbsURL(p string) *Request
- func (r *Request) Body(v any) *Request
- func (r *Request) Cookie(cs ...*http.Cookie) *Request
- func (r *Request) DataJs(data any) *Request
- func (r *Request) Do(ctx context.Context) *Response
- func (r *Request) FormData(key, value string) *Request
- func (r *Request) Header(key string, values ...string) *Request
- func (r *Request) Method(method Method) *Request
- func (r *Request) MultiFormData(key string, values ...string) *Request
- func (r *Request) Param(paramName, value string) *Request
- func (r *Request) Prefix(segments ...string) *Request
- func (r *Request) RowText(t string) *Request
- func (r *Request) SetCarryCookies() *Request
- func (r *Request) SetCarryQueryParameters(severity Severity) *Request
- func (r *Request) SetCert(caPath, clientCrtPath, clientKeyPath string) *Request
- func (r *Request) SetDNS(dnsResolver string) *Request
- func (r *Request) SetIgnoreCert() *Request
- func (r *Request) SetMinVersionTLS(tlsVersion uint16) *Request
- func (r *Request) SetNoAutoRedirect() *Request
- func (r *Request) SetProxyAdd(add string) *Request
- func (r *Request) SetProxyPort(port int) *Request
- func (r *Request) SetProxyScheme(scheme string) *Request
- func (r *Request) SetProxyUrl(u string) *Request
- func (r *Request) Suffix(segments ...string) *Request
- func (r *Request) TarFiles(folderPath string, ...) *Request
- func (r *Request) Timeout(d time.Duration) *Request
- func (r *Request) URL(p string) *Request
- func (r *Request) UploadFiles(fileKey string, filePath string) *Request
- type Response
- func (r *Response) Cookies() []*http.Cookie
- func (r *Response) Encoding() string
- func (r *Response) Error() error
- func (r *Response) GetHeader(key string) string
- func (r *Response) Header(header string, v *string) *Response
- func (r *Response) Headers() http.Header
- func (r *Response) Into(v any) error
- func (r *Response) Raw() ([]byte, error)
- func (r *Response) Status() string
- func (r *Response) StatusCode() int
- func (r *Response) Text() string
- func (r *Response) Url() *url.URL
- type Severity
- type User
Constants ¶
View Source
const ( ACCEPT_HEADER = "Accept" CONTENT_TYPE_HEADER = "Content-Type" CONTENT_ENCODING_HEADER = "Content-Encoding" AUTHORIZATION_HEADER = "Authorization" )
Variables ¶
Functions ¶
func CustomDialContext ¶ added in v0.5.2
func HeaderFilterFlags ¶
func NewDefaultHeader ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewDefaultClient ¶
func NewDefaultClient() *Client
func NewLogLevelClient ¶
func (*Client) SetBasicAuth ¶
func (*Client) SetBearerTokenAuth ¶
func (*Client) SetCarryQueryParameters ¶
设置当跳转的时候,自动携带请求参数
func (*Client) SetContentType ¶
设置Content-Type
func (*Client) SetLogDirPath ¶
func (*Client) SetLogSaveFile ¶
func (*Client) SetMinVersionTLS ¶
设置TLS最低版本
func (*Client) SetProxyAdd ¶
func (*Client) SetProxyPort ¶
func (*Client) SetProxyScheme ¶
func (*Client) SetUserAgent ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func (*Request) MultiFormData ¶
提交多种内容的表单 当上传文件的同时提交表单需要用这个方法
func (*Request) SetCarryQueryParameters ¶
设置当跳转的时候,自动携带请求参数 severity是程度
func (*Request) SetMinVersionTLS ¶
设置TLS最低版本
func (*Request) SetProxyAdd ¶
func (*Request) SetProxyPort ¶
func (*Request) SetProxyScheme ¶
func (*Request) TarFiles ¶
func (r *Request) TarFiles( folderPath string, fileWhitelist, dirWhitelist, fileBlacklist, dirBlacklist []string, ) *Request
为docker远程传输数据实现
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
Click to show internal directories.
Click to hide internal directories.