1 Star 1 Fork 1

xiaoyutab / xgotool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
http.go 888 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaoyutab 提交于 2023-12-27 17:15 . 更新新版https请求
package xgotool
import "gitee.com/xiaoyutab/xgotool/https"
// GET请求
//
// url 请求地址
// param 请求参数
// header 请求头,自动追加accept、Content-Type等属性
func Get(url string, param, header map[string]string) *https.CURL {
return https.New(url).Param(param).Header(header).Get()
}
// Post请求
//
// url 请求地址
// param 请求参数
// header 请求头,自动追加accept、Content-Type等属性
func Post(url string, param, header map[string]string) *https.CURL {
return https.New(url).Param(param).Header(header).Post()
}
// Post请求[此请求会以json形式发送数据]
//
// url 请求地址
// param 请求参数
// header 请求头,自动追加accept、Content-Type等属性
func PostJson(url string, param map[string]any, header map[string]string) *https.CURL {
return https.New(url).ParamJson(param).Header(header).PostJson()
}
Go
1
https://gitee.com/xiaoyutab/xgotool.git
git@gitee.com:xiaoyutab/xgotool.git
xiaoyutab
xgotool
xgotool
v0.3.13

搜索帮助