Files
requests/test/response/rawConn_test.go
2024-12-13 22:19:58 +08:00

25 lines
477 B
Go

package main
import (
"testing"
"github.com/gospider007/requests"
)
func TestRawConn(t *testing.T) {
resp, err := requests.Get(nil, "https://httpbin.org/anything")
if err != nil {
t.Error(err)
}
if resp.Body() != nil {
t.Error("conn is not nil")
}
resp, err = requests.Get(nil, "https://httpbin.org/anything", requests.RequestOption{Stream: true})
if err != nil {
t.Error(err)
}
if resp.Body() == nil {
t.Error("conn is nil")
}
}