httpc

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

View Source
const (
	LogRequest         = 1
	LogResponse        = 2
	NoLogError         = 4
	NoLogNotAuthorized = 8
	NoLogBadStatus     = 16
)

Variables

This section is empty.

Functions

func Object2UrlValues added in v1.0.9

func Object2UrlValues(obj any) url.Values

Types

type BasicAuthCredsSt

type BasicAuthCredsSt struct {
	Username string
	Password string
}

type HttpC

type HttpC interface {
	GetOptions() OptionsSt
	Send(reqBody []byte, opts OptionsSt) ([]byte, error)
	SendJson(reqObj any, opts OptionsSt) ([]byte, error)
	SendRecvJson(reqBody []byte, repObj any, opts OptionsSt) ([]byte, error)
	SendJsonRecvJson(reqObj, repObj any, opts OptionsSt) ([]byte, error)
}

type OptionsSt

type OptionsSt struct {
	Client         *http.Client
	BaseUrl        string
	BaseParams     url.Values
	BaseHeaders    http.Header
	BaseLogPrefix  string
	BasicAuthCreds *BasicAuthCredsSt

	Method        string
	Path          string
	Params        url.Values
	Headers       http.Header
	LogFlags      int
	LogPrefix     string
	RetryCount    int
	RetryInterval time.Duration
	Timeout       time.Duration
}

func (OptionsSt) GetMergedWith

func (o OptionsSt) GetMergedWith(v OptionsSt) OptionsSt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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