A Go (Golang) HTTP client package, designed for robust web communication. It is built with retry policies, digest authentication support, and automatic fallback to HTTP/2, offering a highly resilient solution for making HTTP requests.
MIT License
hq-go-http
is a Go (Golang) HTTP client package, designed for robust web communication. It is built with retry policies, digest authentication support, and automatic fallback to HTTP/2, offering a highly resilient solution for making HTTP requests.
To install the package, run the following command in your terminal:
go get -v -u github.com/hueristiq/hq-go-http
This command will download and install the hq-go-http
package into your Go workspace, making it available for use in your projects.
Here's a simple example demonstrating how to use hq-go-http
:
package main
import (
"log"
http "github.com/hueristiq/hq-go-http"
)
func main() {
client := http.NewClient(&http.ClientConfiguration{
RetryMax: 3, // Max number of retries
Timeout: 10 * time.Second, // Request timeout
RetryWaitMin: 1 * time.Second, // Minimum wait between retries
RetryWaitMax: 5 * time.Second, // Maximum wait between retries
})
response, err := client.Get("https://example.com")
if err != nil {
log.Fatalf("Request failed: %v", err)
}
defer response.Body.Close()
// Handle response here
}
We welcome contributions! Feel free to submit Pull Requests or report Issues. For more details, check out the contribution guidelines.
This package is licensed under the MIT license. You are free to use, modify, and distribute it, as long as you follow the terms of the license. You can find the full license text in the repository - Full MIT license text.
A huge thanks to all the contributors who have helped make hq-go-http
what it is today!
If you're interested in more packages like this, check out:
Hashicorp's go-retryablehttp Project Discovery's retryablehttp-go Gojek's heimdall Monaco's request Opus Domini's fast-shot