1717from types import TracebackType
1818from typing import Any , Callable , Optional , Type , Union
1919
20- import requests
20+ from requests import Response , Session
21+ from requests .adapters import BaseAdapter
2122
2223from reportportal_client ._internal .services .auth import Auth
2324
2728class ClientSession :
2829 """Class wraps requests.Session and adds authentication support."""
2930
30- _client : requests . Session
31+ _client : Session
3132 __auth : Optional [Auth ]
3233
3334 def __init__ (
@@ -38,10 +39,10 @@ def __init__(
3839
3940 :param auth: authentication instance to use for requests
4041 """
41- self ._client = requests . Session ()
42+ self ._client = Session ()
4243 self .__auth = auth
4344
44- def __request (self , method : Callable , url : Union [str , bytes ], ** kwargs : Any ) -> requests . Response :
45+ def __request (self , method : Callable , url : Union [str , bytes ], ** kwargs : Any ) -> Response :
4546 """Make a request with authentication support.
4647
4748 The method adds Authorization header if auth is configured and handles auth refresh
@@ -73,19 +74,19 @@ def __request(self, method: Callable, url: Union[str, bytes], **kwargs: Any) ->
7374
7475 return result
7576
76- def get (self , url : str , ** kwargs : Any ) -> requests . Response :
77+ def get (self , url : Union [ str , bytes ], ** kwargs : Any ) -> Response :
7778 """Perform HTTP GET request."""
7879 return self .__request (self ._client .get , url , ** kwargs )
7980
80- def post (self , url : str , ** kwargs : Any ) -> requests . Response :
81+ def post (self , url : Union [ str , bytes ], ** kwargs : Any ) -> Response :
8182 """Perform HTTP POST request."""
8283 return self .__request (self ._client .post , url , ** kwargs )
8384
84- def put (self , url : str , ** kwargs : Any ) -> requests . Response :
85+ def put (self , url : Union [ str , bytes ], ** kwargs : Any ) -> Response :
8586 """Perform HTTP PUT request."""
8687 return self .__request (self ._client .put , url , ** kwargs )
8788
88- def mount (self , prefix : str , adapter : requests . adapters . BaseAdapter ) -> None :
89+ def mount (self , prefix : str , adapter : BaseAdapter ) -> None :
8990 """Mount an adapter to a specific URL prefix.
9091
9192 :param prefix: URL prefix (e.g., 'http://', 'https://')
0 commit comments