lsrestclient 3.0.1__tar.gz → 3.0.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/PKG-INFO +1 -1
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/response.py +3 -2
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/pyproject.toml +1 -1
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/README.md +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/__init__.py +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/auth.py +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/client.py +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/contexts/__init__.py +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/contexts/bearer_token.py +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/exceptions.py +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/fixtures.py +0 -0
- {lsrestclient-3.0.1 → lsrestclient-3.0.2}/lsrestclient/mock.py +0 -0
@@ -6,6 +6,7 @@ import pydash
|
|
6
6
|
from requests import Response
|
7
7
|
from requests.structures import CaseInsensitiveDict
|
8
8
|
|
9
|
+
|
9
10
|
@dataclass
|
10
11
|
class LsRestClientResponse:
|
11
12
|
"""
|
@@ -19,7 +20,7 @@ class LsRestClientResponse:
|
|
19
20
|
_json: Optional[dict] = None
|
20
21
|
|
21
22
|
def json(self):
|
22
|
-
if self._json is None:
|
23
|
+
if self._json is None and self.content != "":
|
23
24
|
self._json = lsjsonclasses.LSoftJSONDecoder.loads(self.content)
|
24
25
|
return self._json
|
25
26
|
|
@@ -37,7 +38,7 @@ class LsRestClientResponse:
|
|
37
38
|
encoding = pydash.get(response, "encoding", None)
|
38
39
|
headers = pydash.get(response, "headers", None)
|
39
40
|
content_type = headers.get("Content-Type", None)
|
40
|
-
if content_type ==
|
41
|
+
if content_type == "application/pdf":
|
41
42
|
content = response.content
|
42
43
|
else:
|
43
44
|
content = response.content.decode("utf8" if encoding is None else encoding)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|