Documentation
¶
Index ¶
- Variables
- func ApplyProperties(properties *ClientProperties) clientOpt
- func BasicAuth(username, password string) requestOpt
- func BearerToken(token string) requestOpt
- func BindResponseJSON(response *http.Response, v interface{}) error
- func Body(body io.Reader) requestOpt
- func ContentType(contentType string) requestOpt
- func Cookie(cookie *http.Cookie) requestOpt
- func FormBody(form *url.Values) requestOpt
- func GetRequestID(request *http.Request) string
- func Header(key, value string) requestOpt
- func Host(host string) requestOpt
- func JSONBody(body interface{}) requestOpt
- func MaxRetries(maxRetries int) clientOpt
- func Method(method string) requestOpt
- func MultipartForm(parts ...*part) requestOpt
- func NewRequest(opts ...requestOpt) (*http.Request, error)
- func PartFromData(fieldName, fileName string, data interface{}) *part
- func PartFromDiskFile(fieldName, fileName, diskPath string) *part
- func RandomRequestID() requestOpt
- func ReadResponseBody(response *http.Response) ([]byte, error)
- func RetryDelayFactor(retryDelayFactor time.Duration) clientOpt
- func Timeout(timeout time.Duration) clientOpt
- func URL(format string, vars ...interface{}) requestOpt
- func UserAgent(userAgent string) requestOpt
- type Client
- type ClientProperties
Constants ¶
This section is empty.
Variables ¶
View Source
var CONNECT = Method("CONNECT")
View Source
var DELETE = Method("DELETE")
View Source
var GET = Method("GET")
View Source
var HEAD = Method("HEAD")
View Source
var OPTIONS = Method("OPTIONS")
View Source
var POST = Method("POST")
View Source
var PUT = Method("PUT")
View Source
var TRACE = Method("TRACE")
Functions ¶
func ApplyProperties ¶
func ApplyProperties(properties *ClientProperties) clientOpt
func BearerToken ¶
func BearerToken(token string) requestOpt
func BindResponseJSON ¶
func ContentType ¶
func ContentType(contentType string) requestOpt
func GetRequestID ¶
func MaxRetries ¶
func MaxRetries(maxRetries int) clientOpt
func MultipartForm ¶
func MultipartForm(parts ...*part) requestOpt
func NewRequest ¶
func PartFromData ¶
func PartFromData(fieldName, fileName string, data interface{}) *part
func PartFromDiskFile ¶
func PartFromDiskFile(fieldName, fileName, diskPath string) *part
func RandomRequestID ¶
func RandomRequestID() requestOpt
func RetryDelayFactor ¶
Types ¶
type ClientProperties ¶
Click to show internal directories.
Click to hide internal directories.