Documentation ¶
Index ¶
- type CallOptiondeprecated
- func WithCACert(cacert string) CallOptiondeprecated
- func WithConnectTimeoutMsec(tm int) CallOptiondeprecated
- func WithFusingProperties(properties map[string]string) CallOptiondeprecated
- func WithKeepAlive(keepalive bool) CallOptiondeprecated
- func WithRetry(retry int) CallOptiondeprecated
- func WithRpcCluster(cluster string) CallOptiondeprecated
- func WithScheme(scheme string) CallOptiondeprecated
- func WithTimeoutMsec(tm int) CallOptiondeprecated
- type HttpClient
- func (c *HttpClient) Do(ctx *gin.Context, r *http.Request) (retData []byte, retErr error)
- func (c *HttpClient) Do2(ctx *gin.Context, bodyByte []byte, r *http.Request) (retData []byte, retErr error)
- func (c *HttpClient) DoWithHttpResponse(ctx *gin.Context, r *http.Request) (retResp *http.Response, retErr error)
- func (c *HttpClient) DoWithHttpResponse2(ctx *gin.Context, bodyByte []byte, r *http.Request) (retResp *http.Response, retErr error)
- func (c *HttpClient) Get(ctx *gin.Context, uri string, queryString []byte) ([]byte, error)
- func (c *HttpClient) GetWithResp(ctx *gin.Context, uri string, queryString []byte) (retData []byte, retResp *http.Response, retErr error)
- func (c *HttpClient) Post(ctx *gin.Context, url string, contentType string, body []byte) ([]byte, error)
- func (c *HttpClient) PostForm(ctx *gin.Context, uri string, body []byte) ([]byte, error)
- func (c *HttpClient) PostFormWithResp(ctx *gin.Context, uri string, body []byte) (retData []byte, retResp *http.Response, retErr error)
- func (c *HttpClient) PostJson(ctx *gin.Context, uri string, body []byte) ([]byte, error)
- func (c *HttpClient) PostJsonWithResp(ctx *gin.Context, uri string, body []byte) (retData []byte, retResp *http.Response, retErr error)
- func (c *HttpClient) PostWithResp(ctx *gin.Context, url string, contentType string, body []byte) (retData []byte, retResp *http.Response, retErr error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallOption
deprecated
type CallOption func(*callOptions)
Deprecated: Use context.Context instead
func WithCACert
deprecated
func WithCACert(cacert string) CallOption
Deprecated: Use SetCACert instead
func WithConnectTimeoutMsec
deprecated
func WithConnectTimeoutMsec(tm int) CallOption
Deprecated: Use SetConnectTimeoutMsec instead
func WithFusingProperties
deprecated
func WithFusingProperties(properties map[string]string) CallOption
Deprecated: Use SetFusingProperties instead
func WithKeepAlive
deprecated
func WithKeepAlive(keepalive bool) CallOption
Deprecated: Use SetKeepAlive instead
func WithRetry
deprecated
func WithRetry(retry int) CallOption
Deprecated: Use SetRetryNum instead
func WithRpcCluster
deprecated
func WithRpcCluster(cluster string) CallOption
Deprecated: Use SetRpcCluster instead
func WithScheme
deprecated
func WithScheme(scheme string) CallOption
Deprecated: Use SetScheme instead
func WithTimeoutMsec
deprecated
func WithTimeoutMsec(tm int) CallOption
Deprecated: Use SetTimeoutMsec instead
type HttpClient ¶
func NewHttpClient ¶
func NewHttpClient(logger *zap.Logger) *HttpClient
NewHttpClient 创建HttpClient,name "http://baidu.com"
func (*HttpClient) DoWithHttpResponse ¶
func (*HttpClient) DoWithHttpResponse2 ¶
func (*HttpClient) GetWithResp ¶
func (*HttpClient) Post ¶
func (c *HttpClient) Post(ctx *gin.Context, url string, contentType string, body []byte) ([]byte, error)
(t *HttpClient) Post
发送POST请求
func (*HttpClient) PostForm ¶
(t *HttpClient) PostForm
发送POST请求,ContentType为application/x-www-form-urlencoded
func (*HttpClient) PostFormWithResp ¶
func (*HttpClient) PostJsonWithResp ¶
Click to show internal directories.
Click to hide internal directories.