Documentation
¶
Overview ¶
Package web 网络处理相关
Index ¶
- Variables
- func GetData(url string) (data []byte, err error)
- func HeadRequestURL(u string) (string, error)
- func NewDefaultClient() *http.Client
- func NewPixivClient() *http.Client
- func NewTLS12Client() *http.Client
- func PostData(url, contentType string, body io.Reader) (data []byte, err error)
- func RandUA() string
- func RequestDataWith(client *http.Client, url, method, referer, ua string, body io.Reader) (data []byte, err error)
- func RequestDataWithHeaders(client *http.Client, url, method string, setheaders func(*http.Request) error, ...) (data []byte, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var IsSupportIPv6 = syncx.Lazy[bool]{Init: func() bool { resp, err := http.Get("http://v6.ipv6-test.com/json/widgetdata.php?callback=?") if err != nil { log.Info("[web] 本机不支持ipv6") return false } _, _ = io.ReadAll(resp.Body) _ = resp.Body.Close() log.Info("[web] 本机支持ipv6") return true }}
IsSupportIPv6 检查本机是否支持 ipv6
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.