restful ·
Provides basic backoff and stats reporting facilities.
import "github.com/MediaMath/restful
func main() {
type foo struct {
Foo int `json:"foo"`
}
client := restful.WithExpectedResult(http.DefaultClient, http.StatusOK)
fooResponse := &foo{}
status, body, err := restful.DoJSON(client, http.NewRequest("GET", "http://example.com", nil), fooResponse)
if err != nil || fooResponse.Foo != 98 {
log.Fatal("Incorrect", status, body, err)
}
}