mirror of
https://github.com/gospider007/requests.git
synced 2025-12-24 13:57:52 +08:00
sync
This commit is contained in:
@@ -9,9 +9,11 @@ import (
|
||||
|
||||
func TestLocalAddr(t *testing.T) {
|
||||
resp, err := requests.Get(nil, "https://httpbin.org/anything", requests.RequestOption{
|
||||
DialOption: requests.DialOption{
|
||||
LocalAddr: &net.TCPAddr{ //set dns server
|
||||
IP: net.ParseIP("192.168.1.239"),
|
||||
ClientOption: requests.ClientOption{
|
||||
DialOption: requests.DialOption{
|
||||
LocalAddr: &net.TCPAddr{ //set dns server
|
||||
IP: net.ParseIP("192.168.1.239"),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -11,8 +11,10 @@ import (
|
||||
func TestStream(t *testing.T) {
|
||||
resp, err := requests.Get(nil, "https://httpbin.org/anything", requests.RequestOption{
|
||||
Stream: true,
|
||||
Logger: func(l requests.Log) {
|
||||
log.Print(l)
|
||||
ClientOption: requests.ClientOption{
|
||||
Logger: func(l requests.Log) {
|
||||
log.Print(l)
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user