A Go package that provides a client for JSON/REST HTTP services, with automatic retry/backoff.
import "github.com/blizzy78/gojsonclient"
type request struct {
Message string `json:"message"`
}
type response struct {
Reply string `json:"reply"`
}
client := gojsonclient.New()
req := gojsonclient.NewRequest[*request, *response](
"https://www.example.com",
http.MethodGet,
&request{Message: "client"},
)
res, _ := gojsonclient.Do(context.Background(), client, req)
fmt.Println(res.Res.Reply)
// Output: Hello client!
This package is licensed under the MIT license.