Documentation
¶
Index ¶
- func Close(resp *http.Response)
- func Decode(resp *http.Response, output any) error
- func GetBody(resp *http.Response) ([]byte, error)
- func IsValidHttpUrl(url string) bool
- func JoinUrl(baseUrl, relativeUrl string) (string, error)
- func NewHttpTransport(proxyUrl string) (*http.Transport, error)
- type HttpRequestParams
- type Httpx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidHttpUrl ¶
Types ¶
type HttpRequestParams ¶ added in v1.0.23
type HttpRequestParams struct { Ctx context.Context // 上下文 Method string // 请求方法 Url string // 请求地址 Params url.Values // 请求参数 FormData url.Values // 请求表单 Body any // 请求体, io.Reader、[]byte、string、map、struct Header http.Header // 请求头 Cookie string // Cookie Ua string // UserAgent Referer string // Referer ContentType string // Content-Type Proxy string // 代理, 如 http://127.0.0.1:7890、socks5://127.0.0.1:7891、sock5h://127.0.0.1:7892 Timeout time.Duration // 超时 MaxIdleConn int // 最大空闲连接 IdleConnTimeout time.Duration // 空闲连接超时 }
type Httpx ¶
type Httpx struct {
// contains filtered or unexported fields
}
func NewHttpx ¶
func NewHttpx(params HttpRequestParams) *Httpx
func (*Httpx) NewRequest ¶ added in v1.0.23
Click to show internal directories.
Click to hide internal directories.