Versions in this module Expand all Collapse all v0 v0.1.10 Nov 20, 2021 Changes in this version + var DefaultLogInterceptor = LogInterceptor(&LogInterceptorRequest{}) + type Fetch struct + func Delete(ctx context.Context, url string, params ...interface{}) *Fetch + func Get(ctx context.Context, url string, params ...interface{}) *Fetch + func Head(ctx context.Context, url string, params ...interface{}) *Fetch + func New(baseURL string, options ...Option) *Fetch + func Post(ctx context.Context, url string, params ...interface{}) *Fetch + func Put(ctx context.Context, url string, params ...interface{}) *Fetch + func (f *Fetch) AddCookie(cs ...*http.Cookie) *Fetch + func (f *Fetch) AddHeader(args ...interface{}) *Fetch + func (f *Fetch) Bind(bind binding.Binding, v interface{}) error + func (f *Fetch) BindJSON(v interface{}) error + func (f *Fetch) BindXML(v interface{}) error + func (f *Fetch) Body(b body.Body) *Fetch + func (f *Fetch) Bytes() ([]byte, error) + func (f *Fetch) Context() context.Context + func (f *Fetch) Delete(ctx context.Context, path string, params ...interface{}) *Fetch + func (f *Fetch) Form(data interface{}) *Fetch + func (f *Fetch) Get(ctx context.Context, path string, params ...interface{}) *Fetch + func (f *Fetch) Head(ctx context.Context, path string, params ...interface{}) *Fetch + func (f *Fetch) JSON(data interface{}) *Fetch + func (f *Fetch) Method(ctx context.Context, method string, path string, params ...interface{}) *Fetch + func (f *Fetch) MultipartForm(data interface{}, fs ...body.File) *Fetch + func (f *Fetch) Post(ctx context.Context, path string, params ...interface{}) *Fetch + func (f *Fetch) Put(ctx context.Context, path string, params ...interface{}) *Fetch + func (f *Fetch) Query(args ...interface{}) *Fetch + func (f *Fetch) Resp() (*http.Response, []byte, error) + func (f *Fetch) SetBasicAuth(username, password string) *Fetch + func (f *Fetch) SetHeader(args ...interface{}) *Fetch + func (f *Fetch) Text() (string, error) + func (f *Fetch) WithOptions(options ...Option) *Fetch + func (f *Fetch) XML(data interface{}) *Fetch + type Handler func(ctx context.Context, req *http.Request) (*http.Response, []byte, error) + type Interceptor func(ctx context.Context, req *http.Request, handler Handler) (*http.Response, []byte, error) + func LogInterceptor(param *LogInterceptorRequest) Interceptor + type LogInterceptorRequest struct + ExcludeReqHeader map[string]bool + Logger func(ctx context.Context, format string, args ...interface{}) + MaxReqBody int + MaxRespBody int + type Option interface + Apply func(*Fetch) + func Bind(binds map[string]binding.Binding) Option + func Client(c *http.Client) Option + func Debug(debug bool) Option + func Interceptors(interceptors ...Interceptor) Option + func Timeout(t time.Duration) Option + type Options struct + Bind map[string]binding.Binding + Client *http.Client + Debug bool + Interceptors []Interceptor + Timeout time.Duration + func (o *Options) Apply(f *Fetch)