Documentation ¶
Index ¶
- func DeferClose(c io.Closer)
- func DeleteBodyOK(httpClient *http.Client, apiURL string) ([]byte, error)
- func DoBodyOK(httpClient *http.Client, apiURL, method string, reqBody io.Reader) ([]byte, error)
- func GetBodyOK(httpClient *http.Client, apiURL string) ([]byte, error)
- func PostBodyOK(httpClient *http.Client, apiURL string, reqBody io.Reader) ([]byte, error)
- func PutBodyOK(httpClient *http.Client, apiURL string) ([]byte, error)
- func ReadErrorBody(body io.Reader) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeferClose ¶
DeferClose captures and prints the error from closing (if an error occurs). This is designed to be used in a defer statement.
func DeleteBodyOK ¶ added in v1.2.0
DeleteBodyOK will DELETE and returns the body or an error if the response is not okay
func DoBodyOK ¶ added in v1.2.0
DoBodyOK returns the body or an error if the response is not okay(StatusCode >= 400)
func PostBodyOK ¶ added in v1.2.0
PostBodyOK will POST and returns the body or an error if the response is not okay
func PutBodyOK ¶ added in v1.2.0
PutBodyOK will PUT and returns the body or an error if the response is not okay
func ReadErrorBody ¶
ReadErrorBody in the error case ready the body message. But return it as an error (or return an error from reading the body).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.