httpclient

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

type HttpClient

type HttpClient struct {
	Client *http.Client
}

func NewHttpClient

func NewHttpClient(timeout int) *HttpClient

func (*HttpClient) Close

func (hc *HttpClient) Close()

func (*HttpClient) DiscardHTTPResponse

func (hc *HttpClient) DiscardHTTPResponse(response *http.Response)

func (*HttpClient) Get

func (hc *HttpClient) Get(ctx context.Context, getURL, cookies string, headers map[string]string) (*http.Response, error)

func (*HttpClient) HTTPRequest

func (hc *HttpClient) HTTPRequest(ctx context.Context, method, requestURL, cookies string, headers map[string]string, body io.Reader, basicAuth BasicAuth) (*http.Response, error)

func (*HttpClient) Post

func (hc *HttpClient) Post(ctx context.Context, postURL, cookies string, headers map[string]string, body io.Reader) (*http.Response, error)

func (*HttpClient) SimpleGet

func (hc *HttpClient) SimpleGet(ctx context.Context, getURL string) (*http.Response, error)

func (*HttpClient) SimplePost

func (hc *HttpClient) SimplePost(ctx context.Context, postURL, contentType string, body io.Reader) (*http.Response, error)

Jump to

Keyboard shortcuts

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