# README
httputil
HTTP
工具
- 便捷返回
json
、string
、bytes
类型的GET
数据 - 支持带缓存的域名解析
例子
str, err := String("https://www.baidu.com/")
xpanic.WhenError(err)
fmt.Println(str)
dc := dns.NewCache()
client := &http.Client{
Transport: &http.Transport{
DialContext: dc.GetDialContext(),
},
}
c := New(client)
str, err = c.String("https://www.baidu.com/")
xpanic.WhenError(err)
fmt.Println(str)
# Packages
No description provided by the author
# Functions
Bytes 使用默认的 Client 发送 GET 请求,返回 bytes 数据.
Get 使用默认的 Client 发送 GET 请求.
JSON 使用默认的 Client 发送 GET 请求,返回 JSON 数据.
New create new an HTTP client.
Post 使用默认的 Client 发送 POST 请求.
SetDefaultHTTPClient 设置默认的 HTTP Client.
SetDefaultTimeout 设置默认的超时时间.
String 使用默认的 Client 发送 GET 请求,返回 string 数据.
# Interfaces
Client HTTP Client 接口.