httputil

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeferClose

func DeferClose(c io.Closer)

DeferClose captures and prints the error from closing (if an error occurs). This is designed to be used in a defer statement.

func GetBodyOK

func GetBodyOK(httpClient *http.Client, apiURL string) ([]byte, error)

GetBodyOK returns the body or an error if the response is not okay

func ReadErrorBody

func ReadErrorBody(body io.Reader) (err error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL