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

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