httpclient

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 6 Imported by: 1 module, 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 HTTPClient

type HTTPClient interface {
	SetBaseUrl(baseUrl string) HTTPClient
	SetAuthToken(token string) HTTPClient
	Bearer(token string) HTTPClient
	BasicAuth(username, password string) HTTPClient
	SetHeader(key, value string) HTTPClient
	ToJson(any) HTTPClient
	ToBytesBuffer(*[]byte) HTTPClient
	ToPlainText(*string) HTTPClient
	Error(any) HTTPClient
	ContentType(string) HTTPClient
	Get(path string) (*http.Response, error)
	Post(path string, body any) (*http.Response, error)
	Put(path string, body any) (*http.Response, error)
	Delete(path string) (*http.Response, error)
}

func NewHTTPClient

func NewHTTPClient(baseURL, authToken string) HTTPClient

type HTTPClientImpl

type HTTPClientImpl struct {
	BaseURL   string
	AuthToken string

	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func (*HTTPClientImpl) BasicAuth

func (c *HTTPClientImpl) BasicAuth(username, password string) HTTPClient

func (*HTTPClientImpl) Bearer

func (c *HTTPClientImpl) Bearer(token string) HTTPClient

func (*HTTPClientImpl) ContentType

func (c *HTTPClientImpl) ContentType(contentType string) HTTPClient

func (*HTTPClientImpl) Delete

func (c *HTTPClientImpl) Delete(path string) (*http.Response, error)

func (*HTTPClientImpl) Error

func (c *HTTPClientImpl) Error(errVar any) HTTPClient

func (*HTTPClientImpl) Get

func (c *HTTPClientImpl) Get(path string) (*http.Response, error)

func (*HTTPClientImpl) Post

func (c *HTTPClientImpl) Post(path string, body any) (*http.Response, error)

func (*HTTPClientImpl) Put

func (c *HTTPClientImpl) Put(path string, body any) (*http.Response, error)

func (*HTTPClientImpl) SetAuthToken

func (c *HTTPClientImpl) SetAuthToken(token string) HTTPClient

func (*HTTPClientImpl) SetBaseUrl

func (c *HTTPClientImpl) SetBaseUrl(baseURL string) HTTPClient

func (*HTTPClientImpl) SetHeader

func (c *HTTPClientImpl) SetHeader(key, value string) HTTPClient

func (*HTTPClientImpl) ToBytesBuffer

func (c *HTTPClientImpl) ToBytesBuffer(byteArr *[]byte) HTTPClient

func (*HTTPClientImpl) ToJson

func (c *HTTPClientImpl) ToJson(respBody any) HTTPClient

func (*HTTPClientImpl) ToPlainText

func (c *HTTPClientImpl) ToPlainText(textResponse *string) HTTPClient

Jump to

Keyboard shortcuts

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