func DefaultShouldRetry(attempt int, req *http.Request, resp *http.Response, err error) bool {
	var netError net.Error
	switch {
	case errors.Is(err, io.EOF):
		return true
	case errors.As(err, &netError) && (netError.Temporary() || netError.Timeout()):
		return true
	case err != nil:
		return false
	case resp.StatusCode == 500, resp.StatusCode > 501, resp.StatusCode == 429:
		return true
	}
	return false
}
DefaultShouldRetry is the default ShouldRetryer.  It retries the request if the error is
a timeout, temporary, or EOF error, or if the status code is 429, >=500, except for 501 (Not Implemented).
package requester
import (
	"bytes"
	"errors"
	"github.com/ansel1/merry"
	"io"
	"io/ioutil"
	"math/rand"
	"net"
	"net/http"
	"time"
)
var DefaultRetryConfig = RetryConfig{}
var DefaultBackoff = ExponentialBackoff{
	BaseDelay:  1.0 * time.Second,
	Multiplier: 1.6,
	Jitter:     0.2,
	MaxDelay:   120 * time.Second,
}