Versions in this module Expand all Collapse all v0 v0.1.0 Oct 24, 2022 Changes in this version + const Delete + const Get + const Head + const Options + const Patch + const Post + const Put + var DebugOutputBoxWidth = 60 + var DefaultClient = MustClient(``) + var DefaultMultipartFormFileField = `filename` + var FormUnmarshalStructTag = `json` + var Logger = logging.MustGetLogger(`httputil`) + var NetrcFile = `~/.netrc` + var WaitForPollInterval = time.Second + func AddQ(u *url.URL, key string, values ...interface{}) + func AddQString(u string, key string, value interface{}) string + func DecodeResponse(response *http.Response) (io.Reader, error) + func DelQ(u *url.URL, key string) + func DelQString(u string, key string) string + func EncodeBasicAuth(username string, password string) string + func GetBody(url string) ([]byte, error) + func Is1xx(code int) bool + func Is2xx(code int) bool + func Is3xx(code int) bool + func Is4xx(code int) bool + func Is5xx(code int) bool + func IsHttpErr(err error) bool + func IsMediaType(req *http.Request, mediaTypes ...string) bool + func JSONDecoder(in io.Reader, out interface{}) error + func JSONEncoder(in interface{}) (io.Reader, error) + func LoadCertPool(filename string) (*x509.CertPool, error) + func MediaType(req *http.Request) string + func MultipartFormEncoder(in interface{}) (io.Reader, error) + func NetrcCredentials(domain string) (string, string, bool) + func ParseFormRequest(req *http.Request, into interface{}) error + func ParseFormValues(formValues url.Values, into interface{}) error + func ParseJSON(r io.Reader, into interface{}) error + func ParseJSONRequest(req *http.Request, into interface{}) error + func ParseRequest(req *http.Request, into interface{}) error + func Q(req *http.Request, key string, fallbacks ...string) string + func QBool(req *http.Request, key string, fallbacks ...bool) bool + func QDuration(req *http.Request, key string) time.Duration + func QFloat(req *http.Request, key string, fallbacks ...float64) float64 + func QInt(req *http.Request, key string, fallbacks ...int64) int64 + func QStrings(req *http.Request, key string, delimiter string, fallbacks ...string) []string + func QTime(req *http.Request, key string) time.Time + func RequestGetValue(req *http.Request, key string) typeutil.Variant + func RequestSetValue(req *http.Request, key string, value interface{}) + func RespondJSON(w http.ResponseWriter, data interface{}, status ...int) + func SetContentTypeParser(contentType string, parser RequestParseFunc) + func SetQ(u *url.URL, key string, value interface{}) + func SetQString(u string, key string, value interface{}) string + func SetRootCABundle(client *http.Client, caBundle string) error + func UrlPathJoin(baseurl interface{}, path string) (*url.URL, error) + func WaitForHTTP(url string, timeout time.Duration, c ...*http.Client) error + func XMLDecoder(in io.Reader, out interface{}) error + type Client struct + func MustClient(baseURI string) *Client + func NewClient(baseURI string) (*Client, error) + func (self *Client) AppendTrustedRootCA(pemFilenamesOrData ...interface{}) error + func (self *Client) ClearHeaders() + func (self *Client) ClearParams() + func (self *Client) Client() *http.Client + func (self *Client) Decode(r io.Reader, out interface{}) error + func (self *Client) Delete(path string, params map[string]interface{}, headers map[string]interface{}) (*http.Response, error) + func (self *Client) Encode(in interface{}) ([]byte, error) + func (self *Client) Get(path string, params map[string]interface{}, headers map[string]interface{}) (*http.Response, error) + func (self *Client) GetWithBody(path string, body interface{}, params map[string]interface{}, ...) (*http.Response, error) + func (self *Client) Headers() http.Header + func (self *Client) Params() map[string]interface{} + func (self *Client) Post(path string, body interface{}, params map[string]interface{}, ...) (*http.Response, error) + func (self *Client) Put(path string, body interface{}, params map[string]interface{}, ...) (*http.Response, error) + func (self *Client) Request(method Method, path string, body interface{}, params map[string]interface{}, ...) (*http.Response, error) + func (self *Client) SetAutomaticLogin(on bool) + func (self *Client) SetBasicAuth(username string, password string) + func (self *Client) SetClient(client *http.Client) + func (self *Client) SetDecoder(fn DecoderFunc) + func (self *Client) SetEncoder(fn EncoderFunc) + func (self *Client) SetErrorDecoder(fn ErrorDecoderFunc) + func (self *Client) SetHeader(name string, value interface{}) + func (self *Client) SetInitHook(fn InitRequestFunc) + func (self *Client) SetInsecureTLS(insecure bool) + func (self *Client) SetParam(name string, value interface{}) + func (self *Client) SetPostRequestHook(fn InterceptResponseFunc) + func (self *Client) SetPreRequestHook(fn InterceptRequestFunc) + func (self *Client) SetRootCA(pemFilenamesOrData ...interface{}) error + func (self *Client) URI() *url.URL + func (self *Client) WithDecoder(fn DecoderFunc) *Client + func (self *Client) WithEncoder(fn EncoderFunc) *Client + type DecoderFunc func(io.Reader, interface{}) error + type EncoderFunc func(interface{}) (io.Reader, error) + type ErrorDecoderFunc func(*http.Response) error + type InitRequestFunc func() error + type InterceptRequestFunc func(*http.Request) (interface{}, error) + type InterceptResponseFunc func(*http.Response, interface{}) error + type Literal []byte + type LogLevel int + const Debug + const Error + const Fatal + const Info + const Notice + const Warning + type Method string + type MultipartFormFile struct + Data io.Reader + Filename string + type RequestLogger struct + func NewRequestLogger() *RequestLogger + func (self *RequestLogger) ServeHTTP(rw http.ResponseWriter, req *http.Request, next http.HandlerFunc) + type RequestParseFunc func(*http.Request, interface{}) error + type WritableLogger struct + func NewWritableLogger(level LogLevel, prefix ...string) *WritableLogger + func (self *WritableLogger) Write(p []byte) (int, error)