Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = http.Client{ Timeout: time.Minute * 5, }
Functions ¶
func Download ¶
Download downloads the file at the provided URL using the default client. It returns the response in a bytes.Buffer.
func DownloadWithClient ¶
DownloadWithClient downloads the file at the provided URL using the provided client. It returns the response in a bytes.Buffer if successful.
func HandleResponse ¶
HandleResponse is a utility function for standardizing failed responses. It checks the HTTP status code for a success response (200-299), and will attach the body of the response in the event of a non-200 response. This should be called immediately after an HTTP request, rather than checking immediately for the error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.