Go HTTP Client library built atop the standard library's net/http.Client.
go get -u github.com/ghifari160/zeipackage main
import "github.com/ghifari160/zei"
func main() {
client := zei.New(&zei.Config{})
resp, err := client.Get("http://example.com/")
if err != nil {
// Handle error
}
defer resp.Body.Close()
// ...
}client := zei.New(&zei.Config{UserAgent: "App/1.0"})
resp, err := client.Get("http://example.com/")client := zei.New(&zei.Config{Timeout: 1 * time.Minute})
resp, err := client.Get("http://example.com/")config := zei.Config{}
// Basic Authentication
config.SetBasicAuth("username", "password")
// Bearer Authentication
config.SetBearerAuth("token_value")
client := zei.New(&config)
resp, err := client.Get("http://example.com/")