web

package
v0.0.0-...-21c4fd5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: GPL-3.0 Imports: 10 Imported by: 140

Documentation

Overview

Package web 网络处理相关

Index

Constants

This section is empty.

Variables

View Source
var IsSupportIPv6 = &ip.IsIPv6Available

IsSupportIPv6 检查本机是否支持 ipv6

Functions

func GetData

func GetData(url string) (data []byte, err error)

GetData 获取数据

func HeadRequestURL

func HeadRequestURL(u string) (newu string, err error)

HeadRequestURL 获取跳转后的链接

func NewDefaultClient

func NewDefaultClient() *http.Client

NewDefaultClient ...

func NewPixivClient

func NewPixivClient() *http.Client

NewPixivClient P站特殊客户端

func NewTLS12Client

func NewTLS12Client() *http.Client

NewTLS12Client ...

func PostData

func PostData(url, contentType string, body io.Reader) (data []byte, err error)

PostData 获取数据

func RandUA

func RandUA() string

RandUA 随机 UA

func RequestDataWith

func RequestDataWith(client *http.Client, url, method, referer, ua string, body io.Reader) (data []byte, err error)

RequestDataWith 使用自定义请求头获取数据

func RequestDataWithHeaders

func RequestDataWithHeaders(client *http.Client, url, method string, setheaders func(*http.Request) error, body io.Reader) (data []byte, err error)

RequestDataWithHeaders 使用自定义请求头获取数据

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL