Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Do ¶
func Do(req *http.Request, thing interface{}, opts ...*RequestOption) error
Do does the request and JSON-marshals the result into thing, if non-nil.
Types ¶
type RequestOption ¶
type RequestOption struct {
// contains filtered or unexported fields
}
RequestOption are optional arguemnts to Get, Post, or Do.
func WithRequestHeader ¶
func WithRequestHeader(k, v string) *RequestOption
WithRequestHeader adds a header entry to the request.
func WithSizeLimit ¶
func WithSizeLimit(limit int64) *RequestOption
WithSizeLimit sets a size limit for a response. See defaultResponseSizeLimit for the default.
func WithStatusFunc ¶
func WithStatusFunc(f func(int)) *RequestOption
WithStatusFunc calls a function with the status code after the request is performed.
Click to show internal directories.
Click to hide internal directories.