api name change

This commit is contained in:
bxd
2023-11-20 14:26:13 +08:00
parent 9d46922c01
commit 0d4cb5a4d4
5 changed files with 64 additions and 64 deletions

View File

@@ -11,7 +11,7 @@ import (
func TestErrCallBack(t *testing.T) {
n := 0
_, err := requests.Get(nil, "https://httpbin.org/anything", requests.RequestOption{
TryNum: 3,
MaxRetries: 3,
ResultCallBack: func(ctx context.Context, client *requests.Client, response *requests.Response) error {
return errors.New("try")
},

View File

@@ -8,10 +8,10 @@ import (
"github.com/gospider007/requests"
)
func TestTryNum(t *testing.T) {
func TestMaxRetries(t *testing.T) {
n := 0
resp, err := requests.Get(nil, "https://httpbin.org/anything", requests.RequestOption{
TryNum: 3,
MaxRetries: 3,
ResultCallBack: func(ctx context.Context, client *requests.Client, response *requests.Response) error {
if n == 0 {
n++