File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -51,36 +51,33 @@ async def _request(
5151 retry : int = 3 ,
5252 method : str = "get" ,
5353 data : str | None = None ,
54- headers : dict [str , str ] | None = None ,
5554 ) -> etree :
5655 """Get/put/delete data from a give URL."""
5756 resp : ClientResponse
5857 url = f"{ self ._endpoint } { command } "
59- use_headers = headers
60-
6158 try :
6259 match method :
6360 case "delete" :
6461 resp = await self ._websession .delete (url , auth = self ._auth )
6562 case "get" :
6663 # Work-around for Stretchv2, should not hurt the other smiles
67- use_headers = {"Accept-Encoding" : "gzip" }
64+ headers = {"Accept-Encoding" : "gzip" }
6865 resp = await self ._websession .get (
69- url , headers = use_headers , auth = self ._auth
66+ url , headers = headers , auth = self ._auth
7067 )
7168 case "post" :
72- use_headers = {"Content-type" : "text/xml" }
69+ headers = {"Content-type" : "text/xml" }
7370 resp = await self ._websession .post (
7471 url ,
75- headers = use_headers ,
72+ headers = headers ,
7673 data = data ,
7774 auth = self ._auth ,
7875 )
7976 case "put" :
80- use_headers = {"Content-type" : "text/xml" }
77+ headers = {"Content-type" : "text/xml" }
8178 resp = await self ._websession .put (
8279 url ,
83- headers = use_headers ,
80+ headers = headers ,
8481 data = data ,
8582 auth = self ._auth ,
8683 )
You can’t perform that action at this time.
0 commit comments