lsrestclient 3.0.1__py3-none-any.whl → 3.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lsrestclient/response.py +3 -2
- {lsrestclient-3.0.1.dist-info → lsrestclient-3.0.2.dist-info}/METADATA +1 -1
- {lsrestclient-3.0.1.dist-info → lsrestclient-3.0.2.dist-info}/RECORD +5 -5
- {lsrestclient-3.0.1.dist-info → lsrestclient-3.0.2.dist-info}/WHEEL +0 -0
- {lsrestclient-3.0.1.dist-info → lsrestclient-3.0.2.dist-info}/entry_points.txt +0 -0
lsrestclient/response.py
CHANGED
@@ -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)
|
@@ -6,8 +6,8 @@ lsrestclient/contexts/bearer_token.py,sha256=GZZOzAI2Ng_9DvFCbhv1Wwb8wJ1AYCca3fQ
|
|
6
6
|
lsrestclient/exceptions.py,sha256=exJd1BfygNkkAqekmWepVXvXlMiOInVzPRnq7TmPURs,2149
|
7
7
|
lsrestclient/fixtures.py,sha256=dFkAYQXL6xqTOwRofb03Nsu_cIjq1sG10Rh8dxWfz9s,239
|
8
8
|
lsrestclient/mock.py,sha256=Ya12F0t5sXHTSt-X4jDDj5ILJx6y6QaBAMXutQMsIRI,1376
|
9
|
-
lsrestclient/response.py,sha256=
|
10
|
-
lsrestclient-3.0.
|
11
|
-
lsrestclient-3.0.
|
12
|
-
lsrestclient-3.0.
|
13
|
-
lsrestclient-3.0.
|
9
|
+
lsrestclient/response.py,sha256=8ovVmVB8gLW3U1EkewdQlPdFYP-YLoOpIH3ATVQc3wc,2189
|
10
|
+
lsrestclient-3.0.2.dist-info/METADATA,sha256=W3mzdeZFyyBiKuw61phWZxZpgZ05SjdyD2ouyKDzppE,6748
|
11
|
+
lsrestclient-3.0.2.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
12
|
+
lsrestclient-3.0.2.dist-info/entry_points.txt,sha256=7lN1XN3lq5Jv5PlpOdIlFrLlFlwzE5MaEWSgMhKASOM,47
|
13
|
+
lsrestclient-3.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|