1 Star 0 Fork 0

Teval/goz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
goz.go 939 Bytes
一键复制 编辑 原始数据 按行查看 历史
Teval 提交于 2021-08-18 01:57 . init
package goz
// NewClient new request object
func NewClient(opts ...Options) *Request {
req := &Request{}
if len(opts) > 0 {
req.opts = opts[0]
} else {
req.opts = Options{}
}
return req
}
// Get send get request
func Get(uri string, opts ...Options) (*Response, error) {
r := NewClient()
return r.Request("GET", uri, opts...)
}
// Post send post request
func Post(uri string, opts ...Options) (*Response, error) {
r := NewClient()
return r.Request("POST", uri, opts...)
}
// Put send put request
func Put(uri string, opts ...Options) (*Response, error) {
r := NewClient()
return r.Request("PUT", uri, opts...)
}
// Patch send patch request
func Patch(uri string, opts ...Options) (*Response, error) {
r := NewClient()
return r.Request("PATCH", uri, opts...)
}
// Delete send delete request
func Delete(uri string, opts ...Options) (*Response, error) {
r := NewClient()
return r.Request("DELETE", uri, opts...)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/teval/goz.git
git@gitee.com:teval/goz.git
teval
goz
goz
v1.2.0

搜索帮助