Versions in this module Expand all Collapse all v0 v0.0.4 May 17, 2023 v0.0.3 May 16, 2023 Changes in this version + type AsyncResponse struct + Err error + Resp *Response + type MultipartParam struct + FieldName string + FileBody io.Reader + FileName string + type Option interface + type OptionFunc func(*Request) + func SetClient(c *http.Client) OptionFunc + func SetCookieJar(c http.CookieJar) OptionFunc + func SetTimeout(t time.Duration) OptionFunc + func SetTransport(t *http.Transport) OptionFunc + type Request struct + func NewRequest(opts ...Option) *Request + func (req *Request) AsyncDelete(url string, ch chan<- *AsyncResponse) + func (req *Request) AsyncGet(url string, ch chan<- *AsyncResponse) + func (req *Request) AsyncPatch(url string, ch chan<- *AsyncResponse) + func (req *Request) AsyncPost(url string, ch chan<- *AsyncResponse) + func (req *Request) AsyncPut(url string, ch chan<- *AsyncResponse) + func (req *Request) BasicAuth(username, password string) *Request + func (req *Request) Body(formValues []byte) *Request + func (req *Request) CustomBody(formValues string, contentType string) *Request + func (req *Request) Delete(url string) (*Response, error) + func (req *Request) FormData(formValues map[string]string) *Request + func (req *Request) Get(url string) (*Response, error) + func (req *Request) Head(url string) (*Response, error) + func (req *Request) Headers(headerVals map[string]string) *Request + func (req *Request) JSON(jsonBody map[string]interface{}) *Request + func (req *Request) MultipartFormData(formData map[string]string) *Request + func (req *Request) Options(url string) (*Response, error) + func (req *Request) Patch(url string) (*Response, error) + func (req *Request) Post(url string) (*Response, error) + func (req *Request) Put(url string) (*Response, error) + func (req *Request) Query(formValues map[string]string) *Request + func (req *Request) Text(formValues string) *Request + func (req *Request) Upload(name, file string) *Request + func (req *Request) UploadFromReader(param MultipartParam) *Request + func (req *Request) Uploads(files map[string]string) *Request + func (req *Request) UploadsFromReader(params []MultipartParam) *Request + type Response struct + func (res *Response) GetBody() io.ReadCloser + func (res *Response) GetBodyAsByte() ([]byte, error) + func (res *Response) GetBodyAsJSONRawMessage() (json.RawMessage, error) + func (res *Response) GetBodyAsString() (string, error) + func (res *Response) GetResp() *http.Response + func (res *Response) GetStatusCode() int + func (res *Response) Protocol() string + func (res *Response) URL() (*url.URL, error) + func (res *Response) UnmarshalBody(v interface{}) error