Documentation ¶
Index ¶
- func AddHttpPrefix(url string) string
- func AddHttpsPrefix(url string) string
- func ClearHttpPrefix(url string) string
- func ConvertSocks5(proxy string) string
- func Download(url string, savePath string, head map[string]any, requestTimeout int, ...) (map[string]string, error)
- func Get(url string, body any, requestTimeout int) (string, int, error)
- func GetDomain(url string) string
- func GetFormWithoutBody(url string, requestTimeout int) (string, int, error)
- func GetJson[TReturn any](url string, body any, requestTimeout int) (TReturn, error)
- func NewClient(url string) *client
- func Post(url string, head map[string]any, body any, contentType string, ...) (string, int, error)
- func PostForm(url string, head map[string]any, body any, requestTimeout int) (string, int, error)
- func PostFormWithoutBody(url string, head map[string]any, requestTimeout int) (string, int, error)
- func PostJson[TReturn any](url string, head map[string]any, body any, requestTimeout int) (TReturn, int, error)
- func RequestProxy(methodName string, requestUrl string, head map[string]any, body any, ...) (string, int, map[string]string, error)
- func RequestProxyConfigure(methodName string, requestUrl string, head map[string]any, body any, ...) (string, int, map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertSocks5 ¶ added in v0.15.0
ConvertSocks5 如果With.Proxy不是socks5协议,则自动添加socks5协议
func Download ¶ added in v0.14.0
func Download(url string, savePath string, head map[string]any, requestTimeout int, proxyAddr string) (map[string]string, error)
Download 下载文件到本地
func GetFormWithoutBody ¶
GetFormWithoutBody http get,application/x-www-form-urlencoded,
func Post ¶
func Post(url string, head map[string]any, body any, contentType string, requestTimeout int) (string, int, error)
Post http post,支持请求超时设置,单位:ms
func PostFormWithoutBody ¶
PostFormWithoutBody http post,application/x-www-form-urlencoded
func PostJson ¶
func PostJson[TReturn any](url string, head map[string]any, body any, requestTimeout int) (TReturn, int, error)
PostJson Post方式将结果反序列化成TReturn
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.