please

package module
v0.0.0-...-f9226ed Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Unlicense Imports: 8 Imported by: 1

README

please

Friendly clients that make requests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Msg

type Msg struct{}

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request is a much faster implementation compared to the standard library one, at the cost of not being 100% compliant.

func NewRequest

func NewRequest(endpoint string) *Request

NewRequest returns a pointer to a new instance of the client. You should store the client on the object level and re-use it, it makes less sense to actually instantiate a new one inside of individual methods, as you lose out on the builtin concurrency and buffer pools.

func (*Request) AddClientCert

func (request *Request) AddClientCert(certs *tls.Config) *Request

AddClientCert configures a client certificate for accessing services that require this type of authorization.

func (*Request) AddHeaders

func (request *Request) AddHeaders(headers map[string]string) *Request

AddHeaders allows you to pass in a map[string]string object which will be iterated over to be converted into HTTP request headers.

func (*Request) Get

func (request *Request) Get(path string, data map[string]interface{}) []byte

func (*Request) GetHeader

func (request *Request) GetHeader(key string) string

func (*Request) Post

func (request *Request) Post(path string, data map[string]interface{}) []byte

func (*Request) Put

func (request *Request) Put(path string, data map[string]interface{}) []byte

Jump to

Keyboard shortcuts

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