func OnlyIdempotentShouldRetry(_ int, req *http.Request, _ *http.Response, _ error) bool {
	switch req.Method {
	case http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodTrace:
		return true
	default:
		return false
	}
}
OnlyIdempotentShouldRetry returns true if the request is using one of the HTTP methods which
are intended to be idempotent: GET, HEAD, OPTIONS, and TRACE.  Should be combined with other criteria
using AllRetryers(), for example:

c.ShouldRetry = AllRetryers(ShouldRetryerFunc(DefaultShouldRetry), ShouldRetryerFunc(OnlyIdempotentShouldRetry))
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,
}
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
}