Documentation ¶
Index ¶
- Variables
- func BindResponseJSON(response *http.Response, v interface{}) error
- func NewRequest(opts ...RequestOpt) (*http.Request, error)
- func ReadResponseBody(response *http.Response) ([]byte, error)
- type Client
- type ClientOpt
- type Part
- type RequestOpt
- func BasicAuth(username, password string) RequestOpt
- func BearerToken(token string) RequestOpt
- func Body(body io.Reader) RequestOpt
- func ContentType(contentType string) RequestOpt
- func Cookie(cookie *http.Cookie) RequestOpt
- func FormBody(form *url.Values) RequestOpt
- func Header(key, value string) RequestOpt
- func Host(host string) RequestOpt
- func JSONBody(body interface{}) RequestOpt
- func Method(method string) RequestOpt
- func MultipartForm(parts ...*Part) RequestOpt
- func URL(url string) RequestOpt
- func UserAgent(userAgent string) RequestOpt
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BindResponseJSON ¶
func NewRequest ¶
func NewRequest(opts ...RequestOpt) (*http.Request, error)
Types ¶
type Part ¶
type Part struct {
// contains filtered or unexported fields
}
func PartFromData ¶
func PartFromDiskFile ¶
type RequestOpt ¶
type RequestOpt = func(*requestConfig) error
func BasicAuth ¶
func BasicAuth(username, password string) RequestOpt
func BearerToken ¶
func BearerToken(token string) RequestOpt
func Body ¶
func Body(body io.Reader) RequestOpt
func ContentType ¶
func ContentType(contentType string) RequestOpt
func Cookie ¶
func Cookie(cookie *http.Cookie) RequestOpt
func FormBody ¶
func FormBody(form *url.Values) RequestOpt
func Header ¶
func Header(key, value string) RequestOpt
func Host ¶
func Host(host string) RequestOpt
func JSONBody ¶
func JSONBody(body interface{}) RequestOpt
func Method ¶
func Method(method string) RequestOpt
func MultipartForm ¶
func MultipartForm(parts ...*Part) RequestOpt
func URL ¶
func URL(url string) RequestOpt
func UserAgent ¶
func UserAgent(userAgent string) RequestOpt
Click to show internal directories.
Click to hide internal directories.