osbot-utils 2.20.0__py3-none-any.whl → 2.21.0__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.
- osbot_utils/utils/Http.py +11 -1
- osbot_utils/version +1 -1
- {osbot_utils-2.20.0.dist-info → osbot_utils-2.21.0.dist-info}/METADATA +2 -2
- {osbot_utils-2.20.0.dist-info → osbot_utils-2.21.0.dist-info}/RECORD +6 -6
- {osbot_utils-2.20.0.dist-info → osbot_utils-2.21.0.dist-info}/LICENSE +0 -0
- {osbot_utils-2.20.0.dist-info → osbot_utils-2.21.0.dist-info}/WHEEL +0 -0
osbot_utils/utils/Http.py
CHANGED
@@ -56,7 +56,6 @@ def http_request(url, data=None, headers=None, method='GET', encoding ='utf-8',
|
|
56
56
|
ssl_request = url.startswith('https://')
|
57
57
|
headers = headers or {}
|
58
58
|
if data:
|
59
|
-
print()
|
60
59
|
if type(data) is not str: # if the data object is not a string
|
61
60
|
if headers.get('Content-Type') == "application/json": # and a json payload is expected
|
62
61
|
data = json.dumps(data) # convert it to json
|
@@ -164,6 +163,17 @@ def POST(url, data='', headers=None):
|
|
164
163
|
def POST_json(*args, **kwargs):
|
165
164
|
return json.loads(POST(*args, **kwargs))
|
166
165
|
|
166
|
+
def POST_json_get_bytes(url=None, data=None):
|
167
|
+
headers = {'Content-Type': "application/json"} # todo add support for providing custom headers
|
168
|
+
kwargs = dict(url = url ,
|
169
|
+
data = data,
|
170
|
+
headers = headers ,
|
171
|
+
method = 'POST' ,
|
172
|
+
encoding = None
|
173
|
+
)
|
174
|
+
response = http_request(**kwargs)
|
175
|
+
return response
|
176
|
+
|
167
177
|
def PUT(url, data='', headers=None):
|
168
178
|
return http_request(url, data, headers, 'PUT')
|
169
179
|
|
osbot_utils/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
v2.
|
1
|
+
v2.21.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: osbot_utils
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.21.0
|
4
4
|
Summary: OWASP Security Bot - Utils
|
5
5
|
License: MIT
|
6
6
|
Author: Dinis Cruz
|
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
|
|
23
23
|
|
24
24
|
Powerful Python util methods and classes that simplify common apis and tasks.
|
25
25
|
|
26
|
-

|
27
27
|
[](https://codecov.io/gh/owasp-sbot/OSBot-Utils)
|
28
28
|
|
29
29
|
|
@@ -335,7 +335,7 @@ osbot_utils/utils/Env.py,sha256=rBksAy6k-J5oAJp-S_JedVlcj1b2VK8V3zsQbacopMc,6076
|
|
335
335
|
osbot_utils/utils/Exceptions.py,sha256=KyOUHkXQ_6jDTq04Xm261dbEZuRidtsM4dgzNwSG8-8,389
|
336
336
|
osbot_utils/utils/Files.py,sha256=yxteAcyhDcUy1_r9Eihx80V16lV_UAE6cvoOe2Dc7DU,23001
|
337
337
|
osbot_utils/utils/Functions.py,sha256=0E6alPJ0fJpBiJgFOWooCOi265wSRyxxXAJ5CELBnso,3498
|
338
|
-
osbot_utils/utils/Http.py,sha256=
|
338
|
+
osbot_utils/utils/Http.py,sha256=ywjQlpKgklPnh7iLMGrbf4vbNMH50sUGX4crZHAfCQc,8201
|
339
339
|
osbot_utils/utils/Int.py,sha256=PmlUdU4lSwf4gJdmTVdqclulkEp7KPCVUDO6AcISMF4,116
|
340
340
|
osbot_utils/utils/Json.py,sha256=TvfDoXwOkWzWH-9KMnme5C7iFsMZOleAeue92qmkH6g,8831
|
341
341
|
osbot_utils/utils/Json_Cache.py,sha256=mLPkkDZN-3ZVJiDvV1KBJXILtKkTZ4OepzOsDoBPhWg,2006
|
@@ -353,8 +353,8 @@ osbot_utils/utils/Toml.py,sha256=Rxl8gx7mni5CvBAK-Ai02EKw-GwtJdd3yeHT2kMloik,166
|
|
353
353
|
osbot_utils/utils/Version.py,sha256=Ww6ChwTxqp1QAcxOnztkTicShlcx6fbNsWX5xausHrg,422
|
354
354
|
osbot_utils/utils/Zip.py,sha256=pR6sKliUY0KZXmqNzKY2frfW-YVQEVbLKiyqQX_lc-8,14052
|
355
355
|
osbot_utils/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
356
|
-
osbot_utils/version,sha256=
|
357
|
-
osbot_utils-2.
|
358
|
-
osbot_utils-2.
|
359
|
-
osbot_utils-2.
|
360
|
-
osbot_utils-2.
|
356
|
+
osbot_utils/version,sha256=iRLKVsS2FheWNhb1-kryF4F9MunxpjaAPbrCshBkSY4,8
|
357
|
+
osbot_utils-2.21.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
358
|
+
osbot_utils-2.21.0.dist-info/METADATA,sha256=w8YOdMhQLXWrJ-hTXsuDjNpRzFDnmijUIsgYaMFqE0o,1329
|
359
|
+
osbot_utils-2.21.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
360
|
+
osbot_utils-2.21.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|