Categorygithub.com/clairmont32/httplib
modulepackage
0.0.0-20230925013828-22683a99c517
Repository: https://github.com/clairmont32/httplib.git
Documentation: pkg.go.dev

# README

My own take on a HTTP wrapper. Likely not the best out there but it's my own personal preference. Inspired by bitly's Gophercon 2020 talk.

go get github.com/clairmont32/httplib

# Functions

DefaultClient provides a default client with 10s timeout.
DefaultRequest provides a standardized way to perform HTTP calls.
ProcessStatusCode process the status codes 200 and 400 return a body with error 429 will sleep for 60s 500 returns only an error if none of the http code categories is appropriate assume a good response and return the body.
ReadRespBody reads and return HTTP response without a buffer.

# Structs

FormRequest contains basic fields needed for a HTTP request it has a method of FormRequest which returns a *http.Request.
Headers sets a key, value to add to the *http.Request call each time a header is needed to be set.

# Type aliases

No description provided by the author