httpcli

package
v2.0.0-...-48c436d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultHttpClient

type DefaultHttpClient struct {
	// contains filtered or unexported fields
}

func NewDefaultHttpClient

func NewDefaultHttpClient() *DefaultHttpClient

func (*DefaultHttpClient) DoRequest

func (cli *DefaultHttpClient) DoRequest(method, rqUrl string, reqBody string, headers map[string]string) (data []byte, err error)

func (*DefaultHttpClient) SetProxy

func (cli *DefaultHttpClient) SetProxy(proxy string) error

func (*DefaultHttpClient) SetTimeout

func (cli *DefaultHttpClient) SetTimeout(sec int64)

type FastHttpCli

type FastHttpCli struct {
	// contains filtered or unexported fields
}

func NewFastHttpCli

func NewFastHttpCli() *FastHttpCli

func (*FastHttpCli) DoRequest

func (cli *FastHttpCli) DoRequest(method, rqUrl string, reqBody string, headers map[string]string) (data []byte, err error)

func (*FastHttpCli) SetProxy

func (cli *FastHttpCli) SetProxy(proxy string) error

func (*FastHttpCli) SetTimeout

func (cli *FastHttpCli) SetTimeout(sec int64)

type IHttpClient

type IHttpClient interface {
	SetTimeout(sec int64)
	SetProxy(proxy string) error
	DoRequest(method, rqUrl string, reqBody string, headers map[string]string) (data []byte, err error)
}
var Cli IHttpClient

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL