Request creation simplified and basic auth test added.

This commit is contained in:
Musab Gültekin
2019-06-17 13:53:34 +03:00
parent a5ec28664d
commit 4177f10de9
4 changed files with 27 additions and 6 deletions

View File

@@ -146,3 +146,13 @@ func TestCookies(t *testing.T) {
CookiesDisabled: true,
}).Start()
}
func TestBasicAuth(t *testing.T) {
geziyor.NewGeziyor(&geziyor.Options{
StartRequestsFunc: func(g *geziyor.Geziyor) {
req, _ := geziyor.NewRequest("GET", "https://httpbin.org/anything", nil)
req.SetBasicAuth("username", "password")
g.Do(req, nil)
},
}).Start()
}