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