1313from typing import Union
1414from urllib .parse import unquote
1515
16- import niquests
16+ import requests
1717from lxml import etree
1818from lxml .etree import _Element
19- from niquests .auth import AuthBase
20- from niquests .models import Response
21- from niquests .structures import CaseInsensitiveDict
19+ from requests .auth import AuthBase
20+ from requests .models import Response
21+ from requests .structures import CaseInsensitiveDict
2222
2323from .elements .base import BaseElement
2424from caldav import __version__
@@ -402,7 +402,7 @@ def expand_simple_props(
402402
403403class DAVClient :
404404 """
405- Basic client for webdav, uses the niquests lib; gives access to
405+ Basic client for webdav, uses the requests lib; gives access to
406406 low-level operations towards the caldav server.
407407
408408 Unless you have special needs, you should probably care most about
@@ -432,26 +432,26 @@ def __init__(
432432 * url: A fully qualified url: `scheme://user:pass@hostname:port`
433433 * proxy: A string defining a proxy server: `hostname:port`
434434 * username and password should be passed as arguments or in the URL
435- * auth, timeout and ssl_verify_cert are passed to niquests .request.
435+ * auth, timeout and ssl_verify_cert are passed to requests .request.
436436 * ssl_verify_cert can be the path of a CA-bundle or False.
437437 * huge_tree: boolean, enable XMLParser huge_tree to handle big events, beware
438438 of security issues, see : https://lxml.de/api/lxml.etree.XMLParser-class.html
439439
440- The niquests library will honor a .netrc-file, if such a file exists
440+ The requests library will honor a .netrc-file, if such a file exists
441441 username and password may be omitted. Known bug: .netrc is honored
442442 even if a username/password is given, ref https://github.com/python-caldav/caldav/issues/206
443443 """
444444 headers = headers or {}
445445
446- self .session = niquests .Session (multiplexed = True )
446+ self .session = requests .Session ()
447447
448448 log .debug ("url: " + str (url ))
449449 self .url = URL .objectify (url )
450450 self .huge_tree = huge_tree
451451 # Prepare proxy info
452452 if proxy is not None :
453453 _proxy = proxy
454- # niquests library expects the proxy url to have a scheme
454+ # requests library expects the proxy url to have a scheme
455455 if "://" not in proxy :
456456 _proxy = self .url .scheme + "://" + proxy
457457
@@ -747,11 +747,10 @@ def request(
747747 and self .username
748748 ):
749749 auth_types = self .extract_auth_types (r_headers ["WWW-Authenticate" ])
750-
751750 if self .username and "digest" in auth_types :
752- self .auth = niquests .auth .HTTPDigestAuth (self .username , self .password )
751+ self .auth = requests .auth .HTTPDigestAuth (self .username , self .password )
753752 elif self .username and "basic" in auth_types :
754- self .auth = niquests .auth .HTTPBasicAuth (self .username , self .password )
753+ self .auth = requests .auth .HTTPBasicAuth (self .username , self .password )
755754 elif self .password and "bearer" in auth_types :
756755 self .auth = HTTPBearerAuth (self .password )
757756 elif "bearer" in auth_types :
@@ -785,11 +784,11 @@ def request(
785784 auth_types = self .extract_auth_types (r_headers ["WWW-Authenticate" ])
786785
787786 if self .password and self .username and "digest" in auth_types :
788- self .auth = niquests .auth .HTTPDigestAuth (
787+ self .auth = requests .auth .HTTPDigestAuth (
789788 self .username , self .password .decode ()
790789 )
791790 elif self .password and self .username and "basic" in auth_types :
792- self .auth = niquests .auth .HTTPBasicAuth (
791+ self .auth = requests .auth .HTTPBasicAuth (
793792 self .username , self .password .decode ()
794793 )
795794 elif self .password and "bearer" in auth_types :
@@ -801,8 +800,8 @@ def request(
801800
802801 # this is an error condition that should be raised to the application
803802 if (
804- response .status == niquests .codes .forbidden
805- or response .status == niquests .codes .unauthorized
803+ response .status == requests .codes .forbidden
804+ or response .status == requests .codes .unauthorized
806805 ):
807806 try :
808807 reason = response .reason
0 commit comments