mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
api name change
This commit is contained in:
@@ -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")
|
||||
},
|
||||
|
||||
@@ -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++
|
||||
|
||||
Reference in New Issue
Block a user