Documentation ¶
Index ¶
- Variables
- func AsJSON(req *http.Request)
- func Delete(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, ...) error
- func GenControlHTTPSClient() *http.Client
- func Get(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, ...) error
- func Post(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, ...) error
- func Put(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, ...) error
- func Reason(r *http.Response) (string, error)
- func Request(method string, url string, r io.Reader, w io.Writer, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ControlClientGenerator = GenControlHTTPSClient
Functions ¶
func Delete ¶
func Delete(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error
Delete perform a request using Request with the DELETE method
func GenControlHTTPSClient ¶ added in v0.7.0
func Get ¶
func Get(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error
Get perform a request using Request with the GET method
func Post ¶
func Post(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error
Post perform a request using Request with the POST method
func Put ¶
func Put(url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuner ...func(*http.Request)) error
Put perform a request using Request with the PUT method
func Reason ¶
Reason returns the reason phrase embedded within the JSON error body, or an error if no reason can be extracted
func Request ¶
func Request(method string, url string, r io.Reader, w io.Writer, clientGenerator func() *http.Client, reqTuners ...func(*http.Request)) error
Request will perform the request to the given url and method sending the content of the given reader as the body and writing all the contents of the response to the given writer. The reader and writer are optional.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.