http

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SimpleHttpClient = NewHttpClient()
)

Functions

func GetDownloadFileName

func GetDownloadFileName(u *url.URL, fileName string, disposition string) string

func HandleRespon2String

func HandleRespon2String(resp *http.Response, err error) (string, error)

Types

type HttpClient

type HttpClient struct {
	http.Client

	UserAgent string
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient() *HttpClient

func (*HttpClient) HttpFormPost

func (hc *HttpClient) HttpFormPost(URL string, header map[string]string, postBody map[string]string) (*http.Response, error)

func (*HttpClient) HttpGet

func (hc *HttpClient) HttpGet(URL string, header map[string]string, params map[string]string) (*http.Response, error)

func (*HttpClient) HttpGetDownloadFile

func (hc *HttpClient) HttpGetDownloadFile(URL string, fileName string) error

func (*HttpClient) HttpPost

func (hc *HttpClient) HttpPost(URL string, header map[string]string, postBody string) (*http.Response, error)

func (*HttpClient) HttpRequest

func (hc *HttpClient) HttpRequest(method string, URL string, header map[string]string, postBody string) (*http.Response, error)

func (*HttpClient) HttpSimpleFormPost

func (hc *HttpClient) HttpSimpleFormPost(URL string, postBody map[string]string) (*http.Response, error)

func (*HttpClient) HttpSimpleGet

func (hc *HttpClient) HttpSimpleGet(URL string) (*http.Response, error)

func (*HttpClient) SetProxy

func (hc *HttpClient) SetProxy(proxy string) error

such as http://127.0.0.1:8080 socks5://127.0.0.1:1080

Jump to

Keyboard shortcuts

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