httpkit

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = &http.Client{
	Transport: &http.Transport{
		DialContext: (&net.Dialer{
			Timeout: 15 * time.Second,
		}).DialContext,
		TLSHandshakeTimeout:   15 * time.Second,
		ResponseHeaderTimeout: 15 * time.Second,
		MaxIdleConnsPerHost:   16,
	},
	Timeout: 60 * time.Second,
}

Functions

func WebDo

func WebDo(base *WebBase) ([]byte, error)

http 请求的工具函数

Types

type WebBase

type WebBase struct {
	Url    string            // 请求地址
	Method string            // 请求方法
	Header map[string]string // 请求头
	Body   io.Reader         // 请求体
}

Jump to

Keyboard shortcuts

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