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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-http_request
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Python http response utils.
5
5
  Home-page: https://github.com/ChenyangGao/python-modules/tree/main/python-http_request
6
6
  License: MIT
@@ -2,7 +2,7 @@
2
2
  # encoding: utf-8
3
3
 
4
4
  __author__ = "ChenyangGao <https://chenyanggao.github.io>"
5
- __version__ = (0, 1, 4)
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):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-http_request"
3
- version = "0.1.4"
3
+ version = "0.1.5"
4
4
  description = "Python http response utils."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"