Fetch the repository succeeded.
package gout
import (
"net/http"
"github.com/guonaihong/gout/dataflow"
)
type Client struct {
options
}
// NewWithOpt 设计哲学
// 1.一些不经常变化的配置放到NewWithOpt里面实现
// 2.一些和http.Client深度绑定的放到NewWithOpt里面实现
// 3.一些可以提升使用体验的放到NewWithOpt里面实现
func NewWithOpt(opts ...Option) *Client {
c := &Client{}
c.hc = &http.Client{}
for _, o := range opts {
o.apply(&c.options)
}
return c
}
// GET send HTTP GET method
func (c *Client) GET(url string) *dataflow.DataFlow {
return dataflow.New(c.hc).GET(url).SetSetting(c.Setting)
}
// POST send HTTP POST method
func (c *Client) POST(url string) *dataflow.DataFlow {
return dataflow.New(c.hc).POST(url).SetSetting(c.Setting)
}
// PUT send HTTP PUT method
func (c *Client) PUT(url string) *dataflow.DataFlow {
return dataflow.New(c.hc).PUT(url).SetSetting(c.Setting)
}
// DELETE send HTTP DELETE method
func (c *Client) DELETE(url string) *dataflow.DataFlow {
return dataflow.New(c.hc).DELETE(url).SetSetting(c.Setting)
}
// PATCH send HTTP PATCH method
func (c *Client) PATCH(url string) *dataflow.DataFlow {
return dataflow.New(c.hc).PATCH(url).SetSetting(c.Setting)
}
// HEAD send HTTP HEAD method
func (c *Client) HEAD(url string) *dataflow.DataFlow {
return dataflow.New(c.hc).HEAD(url).SetSetting(c.Setting)
}
// OPTIONS send HTTP OPTIONS method
func (c *Client) OPTIONS(url string) *dataflow.DataFlow {
return dataflow.New(c.hc).OPTIONS(url).SetSetting(c.Setting)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。