client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	HttpOptions
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(option *HttpOptions) *HttpClient

NewHttpClient 创建新Http请求器

func (HttpClient) Do

func (c HttpClient) Do(req *http.Request) (*http.Response, error)

func (HttpClient) Get

func (c HttpClient) Get(url string) (*http.Response, error)

func (HttpClient) GetReader

func (c HttpClient) GetReader(url string) (io.Reader, error)

GetReader 通过Get请求获取回包Body(io.Reader)

func (HttpClient) Post

func (c HttpClient) Post(url, contentType string, body io.Reader) (*http.Response, error)

type HttpOptions

type HttpOptions struct {
	TryTime int
	Timeout time.Duration
}

Jump to

Keyboard shortcuts

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