python-http_request 0.1.4__tar.gz → 0.1.5__tar.gz
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.
- {python_http_request-0.1.4 → python_http_request-0.1.5}/PKG-INFO +1 -1
- {python_http_request-0.1.4 → python_http_request-0.1.5}/http_request/__init__.py +11 -1
- {python_http_request-0.1.4 → python_http_request-0.1.5}/pyproject.toml +1 -1
- {python_http_request-0.1.4 → python_http_request-0.1.5}/LICENSE +0 -0
- {python_http_request-0.1.4 → python_http_request-0.1.5}/http_request/py.typed +0 -0
- {python_http_request-0.1.4 → python_http_request-0.1.5}/readme.md +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# encoding: utf-8
|
|
3
3
|
|
|
4
4
|
__author__ = "ChenyangGao <https://chenyanggao.github.io>"
|
|
5
|
-
__version__ = (0, 1,
|
|
5
|
+
__version__ = (0, 1, 5)
|
|
6
6
|
__all__ = [
|
|
7
7
|
"SupportsGeturl", "url_origin", "complete_url", "ensure_ascii_url",
|
|
8
8
|
"urlencode", "cookies_str_to_dict", "headers_str_to_dict_by_lines",
|
|
@@ -479,6 +479,11 @@ def normalize_request_args(
|
|
|
479
479
|
elif data is not None:
|
|
480
480
|
if isinstance(data, Buffer):
|
|
481
481
|
pass
|
|
482
|
+
elif isinstance(data, SupportsRead):
|
|
483
|
+
if async_:
|
|
484
|
+
data = bio_chunk_async_iter(data)
|
|
485
|
+
else:
|
|
486
|
+
data = bio_chunk_iter(data)
|
|
482
487
|
elif isinstance(data, (str, UserString)):
|
|
483
488
|
data = data.encode(charset)
|
|
484
489
|
elif isinstance(data, AsyncIterable):
|
|
@@ -504,6 +509,11 @@ def normalize_request_args(
|
|
|
504
509
|
elif json is not None:
|
|
505
510
|
if isinstance(json, Buffer):
|
|
506
511
|
data = json
|
|
512
|
+
elif isinstance(json, SupportsRead):
|
|
513
|
+
if async_:
|
|
514
|
+
data = bio_chunk_async_iter(json)
|
|
515
|
+
else:
|
|
516
|
+
data = bio_chunk_iter(json)
|
|
507
517
|
elif isinstance(json, AsyncIterable):
|
|
508
518
|
data = async_map(ensure_value, json)
|
|
509
519
|
elif isinstance(json, Iterator):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|