From 3c2376667409ab7e2ff4606e3fa00ea600d75902 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 1 Apr 2020 18:05:17 +0800 Subject: [PATCH] readme update --- DONATOR.MD | 2 ++ net/ghttp/ghttp_client_content.go | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/DONATOR.MD b/DONATOR.MD index 74a72290c..e1e9ababf 100644 --- a/DONATOR.MD +++ b/DONATOR.MD @@ -69,6 +69,8 @@ We currently accept donation by Alipay/WechatPay, please note your github/gitee |1*1x|wechat|¥100.00| |[ywanbing](https://github.com/ywanbing)|wechat|¥66.66| |[侯哥](http://www.macnie.com)|wechat|¥10.00| +|如果🍋|alipay|¥100.00| 错误的奶茶^_^ +|蔡蔡|wechat|666.00| gf真强大,让项目省心 diff --git a/net/ghttp/ghttp_client_content.go b/net/ghttp/ghttp_client_content.go index e44571fa0..d010e3470 100644 --- a/net/ghttp/ghttp_client_content.go +++ b/net/ghttp/ghttp_client_content.go @@ -6,42 +6,62 @@ package ghttp +// GetContent is a convenience method for sending GET request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) GetContent(url string, data ...interface{}) string { return string(c.RequestBytes("GET", url, data...)) } +// PutContent is a convenience method for sending PUT request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) PutContent(url string, data ...interface{}) string { return string(c.RequestBytes("PUT", url, data...)) } +// PostContent is a convenience method for sending POST request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) PostContent(url string, data ...interface{}) string { return string(c.RequestBytes("POST", url, data...)) } +// DeleteContent is a convenience method for sending DELETE request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) DeleteContent(url string, data ...interface{}) string { return string(c.RequestBytes("DELETE", url, data...)) } +// HeadContent is a convenience method for sending HEAD request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) HeadContent(url string, data ...interface{}) string { return string(c.RequestBytes("HEAD", url, data...)) } +// PatchContent is a convenience method for sending PATCH request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) PatchContent(url string, data ...interface{}) string { return string(c.RequestBytes("PATCH", url, data...)) } +// ConnectContent is a convenience method for sending CONNECT request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) ConnectContent(url string, data ...interface{}) string { return string(c.RequestBytes("CONNECT", url, data...)) } +// OptionsContent is a convenience method for sending OPTIONS request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) OptionsContent(url string, data ...interface{}) string { return string(c.RequestBytes("OPTIONS", url, data...)) } +// TraceContent is a convenience method for sending TRACE request, which retrieves and returns +// the result content and automatically closes response object. func (c *Client) TraceContent(url string, data ...interface{}) string { return string(c.RequestBytes("TRACE", url, data...)) } +// RequestContent is a convenience method for sending custom http method request, which +// retrieves and returns the result content and automatically closes response object. func (c *Client) RequestContent(method string, url string, data ...interface{}) string { return string(c.RequestBytes(method, url, data...)) }