lsrestclient 2.0.0__tar.gz → 2.0.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/PKG-INFO +1 -1
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/response.py +8 -2
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/pyproject.toml +1 -1
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/README.md +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/__init__.py +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/auth.py +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/client.py +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/contexts/__init__.py +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/contexts/bearer_token.py +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/exceptions.py +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/fixtures.py +0 -0
- {lsrestclient-2.0.0 → lsrestclient-2.0.1}/lsrestclient/mock.py +0 -0
@@ -6,7 +6,6 @@ import pydash
|
|
6
6
|
from requests import Response
|
7
7
|
from requests.structures import CaseInsensitiveDict
|
8
8
|
|
9
|
-
|
10
9
|
@dataclass
|
11
10
|
class LsRestClientResponse:
|
12
11
|
"""
|
@@ -36,9 +35,16 @@ class LsRestClientResponse:
|
|
36
35
|
"""
|
37
36
|
|
38
37
|
encoding = pydash.get(response, "encoding", None)
|
38
|
+
headers = pydash.get(response, "headers", None)
|
39
|
+
content_type = headers.get("Content-Type", None)
|
40
|
+
if content_type == 'application/pdf':
|
41
|
+
content = response.content
|
42
|
+
else:
|
43
|
+
content = response.content.decode("utf8" if encoding is None else encoding)
|
44
|
+
|
39
45
|
return cls(
|
40
46
|
status_code=response.status_code,
|
41
|
-
content=
|
47
|
+
content=content,
|
42
48
|
headers=response.headers,
|
43
49
|
)
|
44
50
|
|
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
|