// default client
var defaultClient = Client{}
func (c *Client) Get(url string) *Client {
c.url = url
c.method = http.MethodGet
return c
}
func (c *Client) Post(url string) *Client {
c.url = url
c.method = http.MethodPost
return c
}
func (c *Client) Put(url string) *Client {
c.url = url
c.method = http.MethodPut
return c
}
func (c *Client) Delete(url string) *Client {
c.url = url
c.method = http.MethodDelete
return c
}
// Get: http `GET` 请求
func Get(url string) *Client {
return defaultClient.Get(url)
}
// Post: http `POST` 请求
func Post(url string) *Client {
return
defaultClient.Post(url)
}
// Put: http `PUT` 请求
func Put(url string) *Client {
return defaultClient.Put(url)
}
// Delete: http `DELETE` 请求
func Delete(url string) *Client {
return defaultClient.Delete(url)
}