Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 614f40f

Browse files
Version 0.5
1 parent 6083d4d commit 614f40f

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

requests_async/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
from .sessions import Session
1717
from .status_codes import codes
1818

19-
__version__ = "0.4.1"
19+
__version__ = "0.5.0"

requests_async/adapters.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async def send(
5050
method,
5151
url,
5252
headers=headers,
53-
body=body,
53+
data=body,
5454
stream=stream,
5555
ssl=ssl,
5656
timeout=timeout,
@@ -83,15 +83,15 @@ def build_response(self, req, resp):
8383

8484
# Make headers case-insensitive.
8585
response.headers = requests.structures.CaseInsensitiveDict(
86-
[(k.decode("latin1"), v.decode("latin1")) for k, v in resp.headers]
86+
[(k.decode("latin1"), v.decode("latin1")) for k, v in resp.headers.raw]
8787
)
8888

8989
# Set encoding.
9090
response.encoding = requests.utils.get_encoding_from_headers(response.headers)
91-
response.reason = resp.reason
91+
response.reason = resp.reason_phrase
9292

9393
if resp.is_closed:
94-
response._content = resp.body
94+
response._content = resp.content
9595
response._content_consumed = True
9696
else:
9797
response._content = False

requests_async/asgi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async def send(message) -> None:
138138
body = message.get("body", b"")
139139
more_body = message.get("more_body", False)
140140
if request.method != "HEAD":
141-
raw_kwargs["body"] += body
141+
raw_kwargs["content"] += body
142142
if not more_body:
143143
response_complete = True
144144
elif message["type"] == "http.response.template":
@@ -148,7 +148,7 @@ async def send(message) -> None:
148148
request_complete = False
149149
response_started = False
150150
response_complete = False
151-
raw_kwargs = {"body": b""} # type: typing.Dict[str, typing.Any]
151+
raw_kwargs = {"content": b""} # type: typing.Dict[str, typing.Any]
152152
template = None
153153
context = None
154154

requests_async/cookies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def extract_cookies_to_jar(jar, request, response):
1010
:param response: httpcore.Response object
1111
"""
1212
msg = HTTPMessage()
13-
for k, v in response.headers:
13+
for k, v in response.headers.raw:
1414
msg.add_header(k.decode(), v.decode())
1515

1616
# the _original_response field is the wrapped httplib.HTTPResponse object,

0 commit comments

Comments
 (0)