Versions in this module Expand all Collapse all v0 v0.3.1 Nov 28, 2019 Changes in this version + const DELETE + const GET + const HEAD + const OPTIONS + const PATCH + const POST + const PUT + var ErrHookFuncMaxLimit = errors.New("nic: The number of hook functions must be less than 8") + var ErrIndexOutofBound = errors.New("nic: Index out of bound") + type AfterResponseHookFunc func(*http.Response) error + type BeforeRequestHookFunc func(*http.Request) error type H + DisableCompression bool + DisableKeepAlives bool + Params KV + SkipVerifyTLS bool type Session + func (s *Session) RegisterAfterRespHook(fn AfterResponseHookFunc) error + func (s *Session) RegisterBeforeReqHook(fn BeforeRequestHookFunc) error + func (s *Session) ResetAfterRespHook() + func (s *Session) ResetBeforeReqHook() + func (s *Session) UnregisterAfterRespHook(index int) error + func (s *Session) UnregisterBeforeReqHook(index int) error v0.2.1 Sep 29, 2019 Changes in this version type F + FileName string + FilePath string + MimeType string + Src []byte + func File(filename string, src []byte) *F + func FileFromPath(path string) *F + func (f *F) FName(filename string) *F + func (f *F) MIME(mimetype string) *F type H + Chunked bool + type Option interface type Response + func NewResponse(r *http.Response) (*Response, error) + func (r Response) SaveFile(filename string) error type Session + func NewSession() *Session v0.1.2 May 19, 2019 v0.1.1 May 19, 2019 Changes in this version type Response + func (r *Response) Read(x []byte) (int, error) type Session + Client *http.Client + Cookies []*http.Cookie + func (s *Session) GetRequest() *http.Request v0.1.0 May 16, 2019 Changes in this version + var ErrFileInfo = errors.New("Invalid file information") + var ErrInvalidMethod = errors.New("Method is invalid") + var ErrNotJsonResponse = errors.New("Not a Json response") + var ErrParamConflict = errors.New("Options param conflict") + var ErrUnrecognizedEncoding = errors.New("Unrecognized encoding") + type F map[string]KV + type H struct + AllowRedirect bool + Auth KV + Cookies KV + Data KV + Files F + Headers KV + JSON KV + Proxy string + Raw string + Timeout int64 + type KV map[string]string + type Response struct + Bytes []byte + Text string + func Connect(url string, options *H) (*Response, error) + func Delete(url string, options *H) (*Response, error) + func Get(url string, options *H) (*Response, error) + func Head(url string, options *H) (*Response, error) + func Options(url string, options *H) (*Response, error) + func Patch(url string, options *H) (*Response, error) + func Post(url string, options *H) (*Response, error) + func Put(url string, options *H) (*Response, error) + func Trace(url string, options *H) (*Response, error) + func (r *Response) GetEncode() string + func (r *Response) JSON(s interface{}) error + func (r *Response) SetEncode(e string) error + type Session struct + func (s *Session) ClearCookies() + func (s *Session) Connect(url string, options *H) (*Response, error) + func (s *Session) Delete(url string, options *H) (*Response, error) + func (s *Session) Get(url string, options *H) (*Response, error) + func (s *Session) Head(url string, options *H) (*Response, error) + func (s *Session) Options(url string, options *H) (*Response, error) + func (s *Session) Patch(url string, options *H) (*Response, error) + func (s *Session) Post(url string, options *H) (*Response, error) + func (s *Session) Put(url string, options *H) (*Response, error) + func (s *Session) Request(method string, urlStr string, options *H) (*Response, error) + func (s *Session) Trace(url string, options *H) (*Response, error)