Versions in this module Expand all Collapse all v0 v0.0.10 Jun 21, 2021 v0.0.9 Jun 15, 2021 Changes in this version + var ErrResponseBodyHasRead = newError("http response", "body has read") + func GetJSON(path string, result interface{}) error + func GetStream(path string) (io.ReadCloser, error) + func GetText(path string) (string, error) + func PatchJSON(path string, body interface{}, result interface{}) error + func PostJSON(path string, body interface{}, result interface{}) error + func PutJSON(path string, body interface{}, result interface{}) error + func SaveFile(path string, filename string) error + type Builder struct + func NewBuilder() *Builder + func (b *Builder) Client(client *http.Client) *Builder + func (b *Builder) Delete(path string) *Builder + func (b *Builder) Do(client ...*http.Client) Response + func (b *Builder) Get(path string) *Builder + func (b *Builder) Header(k, v string) *Builder + func (b *Builder) Headers(m map[string]string) *Builder + func (b *Builder) Options(path string) *Builder + func (b *Builder) Patch(path string) *Builder + func (b *Builder) Post(path string) *Builder + func (b *Builder) Prefix(p string) *Builder + func (b *Builder) Put(path string) *Builder + func (b *Builder) Queries(m map[string]string) *Builder + func (b *Builder) Query(k, v string) *Builder + func (b *Builder) WriteBody(r io.Reader) *Builder + func (b *Builder) WriteFile(filename string) *Builder + func (b *Builder) WriteFormFile(formName string, fileName string) *Builder + func (b *Builder) WriteJSON(v interface{}) *Builder + func (b *Builder) WriteText(text string) *Builder + func (b *Builder) WriteXML(v interface{}) *Builder + type Response interface + Bytes func() ([]byte, error) + Dump func(body bool) ([]byte, error) + JSON func(value interface{}) error + Pipe func(writer io.Writer) error + Raw func() (*http.Response, error) + SaveFile func(filename string) error + Stream func() (io.ReadCloser, error) + Text func() (string, error) + XML func(value interface{}) error + func ErrorResponse(err error) Response + func Get(path string) Response + func Patch(path string, reader io.Reader, contentType string) Response + func Post(path string, reader io.Reader, contentType string) Response + func PostFile(path string, fileName string) Response + func PostFormFile(path string, formName string, fileName string) Response + func Put(path string, reader io.Reader, contentType string) Response + func WrapResponse(r *http.Response) Response + type Template struct + Client *http.Client + Headers map[string]string + Prefix string + Queries map[string]string + func (t *Template) New() *Builder