http_client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(url string, dest *os.File, headers http.Header) (bool, error)

DownloadFile - Download one file

func Get

func Get(url string, headers http.Header) (*http.Response, error)

Get - Start a Get response and returns the http.Response without parse data.

func GetPageHTML

func GetPageHTML(url string, headers http.Header) (string, error)

func Init

func Init()

func Post

func Post(url string, body interface{}, headers http.Header) (*http.Response, error)

Post sends a post request to the URL with the body

func PostFormURLEncoded

func PostFormURLEncoded(url string, body url.Values, target interface{}) error

PostFormURLEncoded - Send a post request with form url encoded request body

Types

type CustomHTTPClient

type CustomHTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

CustomHTTPClient - Custom http client required to make requests testable

var (
	HttpClient CustomHTTPClient
)

Jump to

Keyboard shortcuts

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